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

From: Eli Barzilay (eli at barzilay.org)
Date: Fri Jun 3 23:50:16 EDT 2011

9 minutes ago, Rodolfo Carvalho wrote:
> 
> Wait wait!  However, Python strings have a special raw-mode
> (raw-strings), suitable for writing regexps...

Ooh, I completely forgot about them.  (For some reason I misremembered
'...' as trying to be "raw".)

> So I've been "lying" all the time. I was not used to write "\d{2}", but
> actually the raw-string r"\d{2}".

Here's how they're not really raw:

  >>> r"foo\"
  [...]
  SyntaxError: EOL while scanning string literal

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                    http://barzilay.org/                   Maze is Life!


Posted on the users mailing list.