<div class="gmail_quote">Eli says that</div><div class="gmail_quote"><br></div><blockquote class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; ">
<meta http-equiv="content-type" content="text/html; charset=utf-8"><span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; ">(BTW, Racket's solution is something that is done in many other<br>
languages too.)</span></blockquote><div class="gmail_quote"><br></div><div class="gmail_quote"><br></div><div class="gmail_quote">I come from Python where I can write</div><div class="gmail_quote"><br></div><div class="gmail_quote">
>>> re.findall("\d{2}", "06/03/2011")</div><div class="gmail_quote">['06', '03', '20', '11']</div><div class="gmail_quote"><br></div><div class="gmail_quote">And printing the string that I used for my regexp gives:</div>
<div class="gmail_quote"><br></div><div class="gmail_quote"><div class="gmail_quote">>>> print "\d{2}"</div><div class="gmail_quote">\d{2}</div><div><br></div></div><div class="gmail_quote"><br></div><div class="gmail_quote">
<br></div><div class="gmail_quote">That is writing strings is not exactly the same as writing "strings for a regexp".</div><div class="gmail_quote"><br></div><div class="gmail_quote"><br></div><div class="gmail_quote">
And then below Neil gives a plausible reason to want the syntax to be the same.</div><div class="gmail_quote"><br></div><div class="gmail_quote">If we are to exploit this consistency, then I see changing my head into typing double backslashes for special regexps constructs a "price worth paying" (given a previous background). For fresh minds, this sounds like a very good idea.</div>
<div class="gmail_quote"><br></div><div class="gmail_quote"><br></div><div class="gmail_quote">On Fri, Jun 3, 2011 at 23:58, Neil Van Dyke <span dir="ltr"><<a href="mailto:neil@neilvandyke.org">neil@neilvandyke.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
[...]
</blockquote>
<br></div>
Also, regexps used to be specified using strings in Racket, and still can be, for good reason:<br>
<br>
(regexp (string-append "^\\d+ " (regexp-quote some-var) "$"))<br>
<br>
#rx"^\\d+"<br>
<br>
As a programmer, getting escaping right is hard enough as it is. You wouldn't want to do escaping one way for string literals and a different way for #rx -- that would be begging for hard-to-find bugs.</blockquote><div>
<br></div><div><br></div><div>[]'s</div><div><br></div><div>Rodolfo Carvalho </div></div>