[racket] issue with function "regexp-replaces"

From: Sean Kanaley (skanaley at gmail.com)
Date: Fri Jun 7 09:24:07 EDT 2013

(regexp-replace* "\n" input-string "\n<br>")

would be the target expansion for those pairs.

On 06/07/2013 08:57 AM, Sanjeev K Sharma wrote:
> I have to clean up a bunch of source files that don't show properly
>
> I have a file from which I'm reading a bunch of regular expressions to replace, things like this:
>
> (#px"(?i:%5C)""/")
>
> but included in the same file (full of from-to pairs) are a bunch of straight string replacements, like this:
>
> ("…""\\&hellip;")
>
>
> I cannot figure out what's wrong with this one: what to do here
>
> ("\n""\n<br>")
>
> it replaces the starting "\n" but never puts in the replacement "\n"
>
> I've doubled/tripled/quadrupled on the backslashes
>
> ("\n""\\n<br>")
> ("\n""\\\n<br>")
>
> but that doesn't put in a newline, rather two separate characters,  "backslash" and "n"
>
> any hints what I'm doing wrong here?
> ____________________
>    Racket Users list:
>    http://lists.racket-lang.org/users


Posted on the users mailing list.