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

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

Four minutes ago, Rodolfo Carvalho wrote:
> On Fri, Jun 3, 2011 at 23:49, Carl Eastlund <cce at ccs.neu.edu> wrote:
> > The origin of #px is "Perl-compatible regular expression", while
> > #rx are compatible with command-line tools such as egrep.
> 
> It seems that it's not yet documented. Good to know, now I can
> choose between Perl and power :D

See the top of http://docs.racket-lang.org/reference/regexp.html --
it shows the basic shared syntax, and then there's

  The following completes the grammar for regexp, which treats { and }
  as literals, \ as a literal within ranges, and \ as a literal
  producer outside of ranges.

and a bit later

  The following completes the grammar for pregexp, which uses { and }
  bounded repetition and uses \ for meta-characters both inside and
  outside of ranges.

These blurbls summarize the difference, and the tables that follow
them specifies the syntax formally.

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


Posted on the users mailing list.