Trigger Matching with Regular Expression

Posted by Mik0la on Thu 22 Jan 2009 07:13 PM — 3 posts, 12,027 views.

#0
I am attempting to omit from output certain characters that appear as a result of an update of my health and who bars. I have read through the regular expression post and have fiddled around tirelessly trying to get the phrases to match.

The single lines appear like this:


 "1594 994>                      @1594@1594@                     "

 "1594 994 >                      !                       "


If it is not posted correctly, there should be many spaces before and after the "@1594@1594@" and "!".

The prompt is variable to change and so are the numbers enclosed in "@" signs.

I have already tried the following and almost every variation thereof:


<trigger
   enabled="y"
   match="^(.*?)(.*?) >*!*"
   omit_from_log="y"
   omit_from_output="y"
   script="on_reset"
   send_to="12"
   sequence="100"
  >
  </trigger>

<trigger
   enabled="y"
   match="^(.*?)(.*?) >*@(\d{1,4})@(\d{1,4})@*"
   omit_from_log="y"
   omit_from_output="y"
   script="on_reset"
   send_to="12"
   sequence="100"
  >
  </trigger>



As of now nothing gets omitted and I just want those two instances to be gagged. I know for a fact that the prompt part of the trigger matches because I use it for my "Chat Redirection" plugin, but not sure exactly how to match the rest of the phrase. Help of any kind would be greatly appreciated. Thank you very much.
Amended on Thu 22 Jan 2009 07:47 PM by Nick Gammon
Australia Forum Administrator #1
You need to check the regular expression box in the trigger dialog.
#2
Wow, I'm sorry I missed something so obvious. Well now that I've got that fixed I've encountered a whole new set of problems, but I guess I'll fiddle with this for awhile before I ask for more help. Thank you very much though.