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
➜ A trigger question
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Helio
(9 posts) Bio
|
Date
| Wed 23 Oct 2002 02:20 PM (UTC) |
Message
| Hi,
I having this problem with some triggers..
Oky, so far this is my trigger,
(John|Jack|Tom|Harry)
I trigger these names so that they change to the colour red when it appears on the output.
Ie: Tom the Hairball ( Tom would be in red )
However, it seems that the client colours anything with the words in the trigger present, for instance Jackal, since it contains Jack thus the Jack is coloured red and -al in Jackal is left unchanged. How can i do it such that the trigger only colours Jack and not Jack-al. | Top |
|
Posted by
| Vaejor
(120 posts) Bio
|
Date
| Reply #1 on Wed 23 Oct 2002 10:54 PM (UTC) Amended on Wed 23 Oct 2002 10:55 PM (UTC) by Vaejor
|
Message
| How about:
"(John|Jack|Tom|Harry)(?: |$)"
Without the quotes.
I tried minimal testing on it and it seems to work.
Basically it checks for a space or end of line after the name to make sure there's no more letters. | Top |
|
Posted by
| Nick Gammon
Australia (23,165 posts) Bio
Forum Administrator |
Date
| Reply #2 on Wed 23 Oct 2002 11:22 PM (UTC) |
Message
| Try this:
\b(John|Jack|Tom|Harry)\b
The \b says "assert this is a word boundary".
Read the file RegularExpressions.txt that comes with MUSHclient for more details about the fancy things you can do with regular expressions.
This will catch other things (eg. name followed by period, comma etc.) |
- 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.
13,493 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top