reg expression

Posted by Avariel on Tue 28 Jan 2003 10:36 PM — 7 posts, 23,445 views.

Portugal #0
i have a few triggers that match name(\,|[ ]|\.|\'|$) to be highlighted... but i dont really want that the "," "." and "'" be highlighted... any sugestion?

thank you..
Australia Forum Administrator #1
Try:


name\b


The \b means "word boundary" but won't actually form part of the matching expression.
Australia Forum Administrator #2
Alternatively, try turning off "capturing of the sub-expression" like this:


name(?:\,|[ ]|\.|\'|$)

Portugal #3
im sorry Nick but either options work... the first dont match with the names and the second keep highlightning the , . and ' too..

thank you anyway
Australia Forum Administrator #4
The first one should work - make it a regular expression. I tried:

nick\b

This highlighted "nick" on its own or as "nick," (the word, not the comma), however did not highlight "nickel".
Portugal #5
hmm this is a litle strange i tried create the trigger manualy and the \bname\b works well but when is created from a script i cant put it in work... it simply dont match.

i think i forgot to tell it from start that i was doing it from a script that takes a few names from an array and creates the same number of triggers. *blush*

thank you Nick and im sorry to take all this time from you for this silly thing *smile*
Australia Forum Administrator #6
If you are adding it from JScript or Perlscript you probably need to "escape" the backslashes by doubling them (eg. \\ instead of \ ).