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
➜ Highlighting under certain conditions
Highlighting under certain conditions
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Glodan
(4 posts) Bio
|
Date
| Tue 11 Mar 2014 03:13 AM (UTC) Amended on Tue 11 Mar 2014 03:14 AM (UTC) by Glodan
|
Message
| I'm trying to do highlight a set of words I have stored in a variable, but only highlight those words when they are situated close to specific other words/characters such as:
pets = cat|dog|fish
Example source:
Quote:
Pet: cat
catnip
[ooc] example says, "Just gave my cat some tunafish, he loves it!"
My desired match/result:
Quote:
Pet: cat
catnip
[ooc] example says, "Just gave my cat some tunafish, he loves it!"
What I've been getting:
Quote:
Pet: cat
catnip
[ooc] example says, "Just gave my cat some tunafish, he loves it!"
I've been experimenting with different 'match' criteria such as:
\b@!pets\b
^Pet: @!pets\s*
I used the inbuilt hightlight text trigger generation and set it to variables and unticked ignore case.
<triggers>
<trigger
custom_colour="11"
enabled="y"
expand_variables="y"
keep_evaluating="y"
make_underline="y"
match="\b@!pets\b"
regexp="y"
repeat="y"
sequence="90"
>
</trigger>
</triggers>
But I'm just not having any luck, could anyone tell me where abouts I'm going wrong ? | Top |
|
Posted by
| Nick Gammon
Australia (23,133 posts) Bio
Forum Administrator |
Date
| Reply #1 on Tue 11 Mar 2014 11:20 AM (UTC) |
Message
| Since you are matching alternatives put them in brackets. Try this:
<triggers>
<trigger
custom_colour="11"
enabled="y"
expand_variables="y"
keep_evaluating="y"
make_underline="y"
match="\b(@!pets)\b"
regexp="y"
repeat="y"
sequence="90"
>
</trigger>
</triggers>
|
- 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.
8,071 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top