In general, it's easier to extract the keyword, then check if it's the one you want.
I agree wholeheartedly. Since the LaTeX name constraint is exact and well-understood (the characters 'a' through 'z' and the characters 'A' through 'Z'), you simply need to match just those characters. Explicitly matching the right-hand boundary isn't necessary.
In reply to Re^2: Defining Characters in Word Boundary?
by Jim
in thread Defining Characters in Word Boundary?
by iaw4
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |