Gammon Forum
Entire forum
MUSHclient
Lua
Highlighting an entire line containing matched regexp
Highlighting an entire line containing matched regexp
|
It is now over 60 days since the last post. This thread is closed.
  Refresh page
Posted by
| Boxknife
(19 posts) bio
|
Date
| Sun 23 Nov 2008 11:38 PM (UTC) |
Message
| I want to write a trigger that highlights everything between quotation marks. Right now I have a trigger set to fire on "*", but it only highlights the quotation marks themselves. I want the trigger to highlight everything in between, too.
How do I do that? | top |
|
Posted by
| Nick Gammon
Australia (22,975 posts) bio
Forum Administrator |
Date
| Reply #1 on Sun 23 Nov 2008 11:49 PM (UTC) |
Message
| |
Posted by
| Boxknife
(19 posts) bio
|
Date
| Reply #2 on Mon 24 Nov 2008 12:53 AM (UTC) |
Message
| <triggers>
<trigger
custom_colour="2"
enabled="y"
group="Highlighted Words"
ignore_case="y"
keep_evaluating="y"
match="\"*\""
regexp="y"
repeat="y"
sequence="90"
other_text_colour="silver"
>
</trigger>
</triggers>
| top |
|
Posted by
| Nick Gammon
Australia (22,975 posts) bio
Forum Administrator |
Date
| Reply #3 on Mon 24 Nov 2008 02:45 AM (UTC) |
Message
| Change it to:
<triggers>
<trigger
custom_colour="2"
enabled="y"
group="Highlighted Words"
ignore_case="y"
keep_evaluating="y"
match="\".*\""
regexp="y"
repeat="y"
sequence="90"
other_text_colour="silver"
>
</trigger>
</triggers>
You need a dot before the *, because .* means "any number of anything". |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | top |
|
Posted by
| Nick Gammon
Australia (22,975 posts) bio
Forum Administrator |
Date
| Reply #4 on Mon 24 Nov 2008 04:36 AM (UTC) |
Message
| You might also want to change from:
to:
The question mark makes the match "less greedy" which will make a difference if you have two lots of quoted things in a single line. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | top |
|
Posted by
| Boxknife
(19 posts) bio
|
Date
| Reply #5 on Mon 24 Nov 2008 02:43 PM (UTC) |
Message
| This works! Thanks. | 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.
14,400 views.
It is now over 60 days since the last post. This thread is closed.
  Refresh page
top
Quick links:
MUSHclient.
MUSHclient help.
Forum shortcuts.
Posting templates.
Lua modules.
Lua documentation.
Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.