Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8392003
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T19:24:20+00:00 2026-06-09T19:24:20+00:00

i think I found a bug in clojure, can anyone explain why the backslash

  • 0

i think I found a bug in clojure, can anyone explain why the backslash is missing from the output?

(clojure.string/replace "The color? is red." #"[?.]"  #(str "zzz\\j" %1 %1))

=> "The colorzzzj?? is redzzzj.."
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T19:24:21+00:00Added an answer on June 9, 2026 at 7:24 pm

    This isn’t a bug. The string returned by the function in the 3rd parameter is parsed for escape sequences so that you can do things like this:

    (clojure.string/replace "The color? is red." #"([?.])" "\\$1$1")
    ; => "The color$1? is red$1."
    

    Notice how the first $ is escaped by the backslash, whereas the second serves as the identifier for a capture group. Change your code to use four backslashes and it works:

    (clojure.string/replace "The color? is red." #"[?.]"  #(str "zzz\\\\j" %1 %1))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I think I've found a bug in safari. I wondered if anyone has encountered
I think I've just found a really strange bug... But it can just be
What if I think, that I found a bug in an open-source-app? What steps
I've found what I think may be a bug with Ivar and Objective-C runtime.
I think all of the tutorials I found are from before you could use
I think I have found a bug when setting or getting the Me.Top property
I think I may have found a bug in PHP's crypt() function under Windows.
I found an interesting bug and wanted to know you think. Brief background: I've
Update: A sample project reproducing this bug can be found here at Microsoft Connect
I think I've found a bug in IE's (IE8) handling for the for-in javascript

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.