That's correct. Flex does not support negative lookahead assertions. It also does not support \w
or \d
, although it does allow posix-style character classes ([[:alpha:]]
, [[:digit:]]
, [[:alnum:]]
, etc.)
Flex regular expressions are quite different from javascript-like or perl/python-like "regular" expressions. For one thing, flex's regular expressions are really regular.
A complete list of the syntaxes flex allows is in the flex manual. Anything not described in that section of the manual is not implemented by flex.
There is very little point using "lookbehind" with flex, because flex always matches the longest token at the current input point. It does not search the input for a pattern.
Flex does implement a limited form of positive lookahead, using the /
operator (which is not part of any regular expression library I know of.) You could use that to only match a sequence of digits not immediately followed by a letter:
[[:digit:]]+/[^[:alpha:]]
But you'll then need some pattern which does match the sequence of digits followed by an alphabetic character, because flex does not search for a matching token.