Reputation: 4284
According to the leex documentation
^ Matches the beginning of a string.
But when I try to use it in a pattern such as ^[^\s\t-:]+[^:].*$
I get this error: bad regexp 'illegal character ^'
Is there a better way to match the begging of a line | string in leex?
Upvotes: 4
Views: 321
Reputation: 21
(Yes, leex does not support an anchor token '^'). You need to use \A anchor instead
Upvotes: 2
Reputation: 5500
At the end of the documentation page you find this note:
Anchoring a regular expression with ^ and $ is not implemented in the current version of Leex and just generates a parse error.
Which seems to mean you can't use ^
and $
with a regexp in between like you do.
If you know the strings end with a specific character (like \n
) I assume you can replace the $
with that char delimiter instead.
Upvotes: 4