Improving std.regex(p)

Ben Hanson Ben.Hanson at tfbplc.co.uk
Tue Jun 22 04:30:59 PDT 2010


== Quote from Nick Sabalausky (a at a.a)'s article
> "Ben Hanson" <Ben.Hanson at tfbplc.co.uk> wrote in message
> news:hvj9i1$1q7b$1 at digitalmars.com...
> > Lua has an interesting pattern matcher, as it goes more in
> > the formal grammar direction to (for example) match balanced parenthesis
> > etc.
> That's cool. That's something I've often wanted in regexes (It would be
> great for defining lever tokens in a grammar-definition language), and
> though I'm no FSA or regex expert, it always seemed like something entirely
> doable without having to resort to a full-blown LL or LR parser.

Yeah, it does seem obvious that there'd be some middle ground between regexes -
certainly the author of the LUA pattern matching thought so! :-) The topic could
definitely do with more attention.

There is limited back-tracking in the LUA pattern matching, which I don't like,
but it appears more efficient than back-tracking NFA.  Apparantly it has some
solid theory behind it too, which is good. Sadly just not enough time to persue
all these possibilities...

Regards,

Ben


More information about the Digitalmars-d mailing list