[asterisk-dev] Better pattern matching

Brian Degenhardt bmd at fourloop.com
Wed Aug 1 21:04:40 CDT 2007


Steve Murphy wrote:
> 
> To add regex's to the mix, will require nothing less than somehow
> gutting the flex (or even lex) program for what it's doing

There's a number of bit-parallel forward scan regex algorithms which use
a bitmask to represent the NFA of a regular expression (nr-grep is one
I've looked at before).  The nice thing about this is that you can
execute multiple regexes on a string at the same time and prune the list
as the NFA fails.  This would work much better than, say, pcre which
uses the code path to represent state.  It also would enable you to
implement ast_matchmore_extension which would be hard with pcre.

Not that I'm advocating rolling your own regex engine. :-)

cheers
-bmd




More information about the asterisk-dev mailing list