Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Due to spam on this forum, all posts now need moderator approval.
Entire forum
➜ MUSHclient
➜ General
➜ reg expression
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Avariel
Portugal (55 posts) Bio
|
Date
| Tue 28 Jan 2003 10:36 PM (UTC) |
Message
| 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.. |
The Avariel Wind Lord | Top |
|
Posted by
| Nick Gammon
Australia (23,158 posts) Bio
Forum Administrator |
Date
| Reply #1 on Tue 28 Jan 2003 10:56 PM (UTC) |
Message
| Try:
name\b
The \b means "word boundary" but won't actually form part of the matching expression.
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Nick Gammon
Australia (23,158 posts) Bio
Forum Administrator |
Date
| Reply #2 on Tue 28 Jan 2003 10:59 PM (UTC) |
Message
| Alternatively, try turning off "capturing of the sub-expression" like this:
name(?:\,|[ ]|\.|\'|$)
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Avariel
Portugal (55 posts) Bio
|
Date
| Reply #3 on Wed 29 Jan 2003 12:20 AM (UTC) |
Message
| 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 |
The Avariel Wind Lord | Top |
|
Posted by
| Nick Gammon
Australia (23,158 posts) Bio
Forum Administrator |
Date
| Reply #4 on Wed 29 Jan 2003 01:47 AM (UTC) |
Message
| 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". |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Avariel
Portugal (55 posts) Bio
|
Date
| Reply #5 on Wed 29 Jan 2003 11:12 PM (UTC) |
Message
| 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* |
The Avariel Wind Lord | Top |
|
Posted by
| Nick Gammon
Australia (23,158 posts) Bio
Forum Administrator |
Date
| Reply #6 on Thu 30 Jan 2003 09:38 PM (UTC) |
Message
| If you are adding it from JScript or Perlscript you probably need to "escape" the backslashes by doubling them (eg. \\ instead of \ ). |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).
To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.
18,331 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top