colour match

Posted by Zhou_shu on Sat 06 Sep 2003 03:14 AM — 4 posts, 15,710 views.

#0
I want to match a red word (other words are not red in this line), but i do not know what the red word is.
I made a trigger like this:
<trigger
enabled="y"
keep_evaluating="y"
match="[a-zA-Z0-9 ]+"
match_inverse="y"
match_italic="y"
match_text_colour="y"
regexp="y"
sequence="148"
text_colour="9"
other_text_colour="black"
other_back_colour="black"
>
</trigger>
If the red word is the start word of the line, the trigger can match the line. If not, it does not work.

Australia Forum Administrator #1
I think what is happening here is that "keep evaluating" means "keep evaluating after a match" however your trigger will match a word, it checks the colour, the colour is not red, thus it is not considered a match.
Australia Forum Administrator #2
What you could do is use a script to GetLineInfo and then GetStyleInfo for that line, work your way through the line (getting the colours for each style run). When you find a style run in red, then you have your red word.
Greece #3
Or check "repeat on same line", under the "regular expression" checkbox.