[racket] Backreference question (regex)

From: Eli Barzilay (eli at barzilay.org)
Date: Sat Oct 30 14:50:23 EDT 2010

Yesterday, Carl Eastlund wrote:
> I'm not sure I know what problem you're running into, but if you use
> Perl regular expression be sure to use (pregexp ...) to compile them
> or #px"..." to write them.  Otherwise you get a slightly different
> regular expression language (compatible with Unix utilities like
> egrep, rather than with Perl).  If you're using those regular
> expressions, they don't have backreferences.

They do:

  -> (regexp-match #rx"(1)\\1" "112")
  '("11" "1")

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


Posted on the users mailing list.