You got lucky... lol
Seriously, though I really do mean that. * and . have completely different meaning in regular expressions than in normal triggers. Basically by licking 'regular expression', you are now telling it to look for:
<space><one or more of> nothing<any character>
This means that it would not only match what you intended, but something like:
It would still capture that single word, but if you had a line like:
"He said: nothing but net!"
it would still color the word, since there is at least two spaces, matching the " * " part and 'nothing' is followed by more stuff. It would also match:
for the same reason and would color " nothingn" in that line, though you wouldn't notice the spaces it captured in any of these cases, unless you had it color the background as well.
To make it work as intended, and not match a lot of stuff you don't want you need to tell it to look for a real "." and an end of line. Since "." has a special meaning <any character>, you need to tell Mushclient you really do want a period by adding a "\". To tell it to look for the end of a line you use "$", so your trigger, to work properly, should be:
"nothing\.$"
This isn't 100% perfect, since it will match on 'any' line that contains "nothing." at the end, but it is as close as you can hope to get, since anything more precise would color everything on a line, not just the word you wanted.
However.. One trick you can use to get around this is to use two triggers:
"^<\w+ \w+ \w+>\s+nothing\.$"
Color: --what you wanted for the 'nothing' word--
Sequence: 99
"^<\w+ \w+ \w+>\s+"
Color: --what you want it to be normally--
Sequence: 100
"^" means, the following *must* be at the start of a line. "\w+" means it will only look for letters that can appear in a word and it will look for more than one. "+" works the same as "*" in regular expressions and means <find more than one of these>. "\s+" looks for any number of spaces. By setting one triggers "sequence" lower than the second one, you can color the entire line, then the second trigger will match and only recolor the first part of the line, returning it to the color you would normally see. The only issue with this is it means you need to make sure to use 'Other...' when picking colors, since the custom colors need to stay the same as the normal ANSI colors. But the "Other..." option is a lot nicer to work with anyway imho. ;) |