|
Ormarr Newbie
Joined: 22 Dec 2009 Posts: 1
|
Posted: Tue Dec 22, 2009 11:20 am
Capture lines with [] |
Greetings,
I tried to capture lines and send them to a different window with the following prefix:
[Abenteuer:Ormarr]
The [] and : are always present, and the text before and after the : changes.
I managed to capture lines before but as soon as it comes to [] I really have a problem to get it going.
If someone could help me out with the right trigger I would appreciate it.
Thank you. |
|
|
|
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Tue Dec 22, 2009 1:46 pm |
A simple trigger pattern of "[*:*]" should match those lines:
Code: |
<trigger priority="10" id="1">
<pattern>[*:*]</pattern>
<value>#cap mywindow</value>
</trigger>
|
If you need to specifically capture and use the values before and after the colon, use the pattern "[(*):(*)]". |
|
|
|
shaun.murray Magician
Joined: 23 Jul 2005 Posts: 334 Location: Chicago
|
Posted: Tue Dec 22, 2009 1:52 pm |
Don't you need a ~ before each and every bracket? If not, I have some work to do on my triggers. ^^
Code: |
#trig {~[(%w):(%w)~]} {#cap mywindow} |
|
|
|
|
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Tue Dec 22, 2009 1:58 pm |
Yes, actually it would be better to put the tilde before the square brackets. Square brackets are used in trigger patterns to specify a range value. However, I did test the pattern I gave, and it works, probably because Cmud recognizes that it cannot be a range value with asterisks inside. But you are correct, it is better to get in the habit of using a tilde, ~, before any square brackets in trigger patterns.
|
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Tue Dec 22, 2009 9:30 pm |
Quote: |
However, I did test the pattern I gave, and it works, probably because Cmud recognizes that it cannot be a range value with asterisks inside.
|
You didn't do much testing. ;) As long as it's not more ranges or a stringlist pattern, any wildcard contained in a range will be evaluated as a wildcard. So, basically, [*:*] is the same as [*] which itself is the same as *. |
|
_________________ EDIT: I didn't like my old signature |
|
|
|
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Wed Dec 23, 2009 1:24 pm |
Ooops Thanks for the correction.
|
|
|
|
|
|