[plt-scheme] Odd behavior in regexp-replace (299.25-cvs4jan2005)

From: Richard Cobbe (cobbe at ccs.neu.edu)
Date: Tue Jan 4 17:57:39 EST 2005

Welcome to MzScheme version 299.25, Copyright (c) 2005 PLT Scheme, Inc.
> (printf "~a~n" (regexp-replace ">>" "abc>>def" "\\red{}"))
> (printf "~a~n" (regexp-replace ">>" "abc>>def" "\\\\red{}"))

I don't understand this -- why should I have to escape the backslash in
order to ensure that the >> is removed from the original string?  Or is
this a bug in regexp-replace that interprets "\\red{}" as though it were

In either case, the observed behavior doesn't match (my interpretation
of) the documentation.



Posted on the users mailing list.