[racket] Some design "whys" of regexps in Racket

From: Rodolfo Carvalho (rhcarvalho at gmail.com)
Date: Sat Jun 4 12:23:22 EDT 2011

#<<BYE

Hello,

On Sat, Jun 4, 2011 at 11:27, Jens Axel Søgaard <jensaxel at soegaard.net>wrote:

> 2011/6/4 Rodolfo Carvalho <rhcarvalho at gmail.com>:
> > Hello,
> > I'm curious about 2 design decisions made:
> > 1) Why do I have to escape things like "\d{2}" -> "\\d{2}"?
>
> You can actually avoid escaping if you use here strings.
> See the example below.
> [...]



Good to learn about here strings. I've seen them somewhere but never paid
much attention.

For short strings I'd rather type things like "\\\\" than
#<<END
\\
END

Because the latter is more verbose and breaks the visual flow.

Both `#<<END' and `END' must come in their own lines, and no line breaks are
considered immediately after and before these tokens, respectively
(reasonable).


Many thanks for this thread! It deserves a post on my blog :D

BYE
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20110604/3abec213/attachment.html>

Posted on the users mailing list.