in reply to Pattern Matching, left-to-right
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.
|
|---|