Regex: escapes in replacement groups are parsed

Problem description:
When using regex to edit regex code, I noticed that escapes are parsed in the capture groups, so \\ is escaped to become \

Expected behavior:
image

1 Like

I’m having trouble understanding your report. Can you share a loom of the actual behavior on Replit and the expected behavior (maybe from another editor where it works)?

oops. I had linked to regex101 but the link ended up on the second image

Hello @UMARismyname, I’m still having some difficulty understanding what is going on here. Is the search and replace engine incorrectly replacing backslashes? If so, can you please send me a one-line example of how something is supposed to behave?

1 Like

should be: regex101: build, test, and debug regex
but it does

(r"(?<!\)__(.+?)(?<!\)__", r"<u>\1</u>"),

Can you please provide me with:

  1. The input
  2. The current and expected output
  3. What the inputs and output of the search + replace operations are supposed to do?
1 Like

I try to swap the two items in the tuple as you can see in the regex101, but on replit it causes the \\ to be converted into \

1 Like

(How did you get that theme…)

You can now create your themes and publish them => https://replit.com/themes/create

2 Likes

solarized - Replit

1 Like