The easy way is of course to use a DFA matcher.
For example, with flex:
$ cat hl.l %option noyywrap %% \\F\\ putchar('|'); \\S\\ putchar('^'); \\T\\ putchar('&'); \\R\\ putchar('~'); \\E\\ putchar('\\'); $ flex hl.l && gcc -lfl -O lex.yy.c -o hl $ ./hl AB\T\F\S\CD AB&F^CD $
There must be lots of DFA regexp packages available for perl on CPAN.
In reply to Re: Pattern Matching, left-to-right
by ambrus
in thread Pattern Matching, left-to-right
by TrekNoid
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |