 |
harley Apprentice
Joined: 05 Apr 2008 Posts: 121
|
Posted: Tue Jun 24, 2008 5:53 pm
Help with regex :( |
one of these days i'll learn this.. but i cant seem to get this to work right:(
I have a capture script I want it to fire on this line
| Code: |
24 Jun 13:48 - xxx tells you 'that was crazy'
|
(timestamp)
and also this line
| Code: |
xxx tells you 'that was crazy'
|
(no stamp)
what i have now is 2 triggers, one for each.
I'm trying to make my triggers better and more efficient.. |
|
|
|
 |
Fang Xianfu GURU

Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Tue Jun 24, 2008 5:55 pm |
Don't anchor. Simply using %w tells you '*' will match both lines, because the first line's match starts later.
|
|
|
|
 |
harley Apprentice
Joined: 05 Apr 2008 Posts: 121
|
Posted: Tue Jun 24, 2008 9:46 pm |
Thanks, only problem is if someone quotes another tell, it comes up in capture.
Though not a big problem.. I'll work it out |
|
|
|
 |
Toxic Adept
Joined: 27 May 2008 Posts: 299
|
Posted: Tue Jun 24, 2008 9:51 pm |
#TR {^{%d %w * - |}%w tells you '*'}
This will/should trigger off both lines and also force them to be at the start of a new line |
|
|
|
 |
charneus Wizard

Joined: 19 Jun 2005 Posts: 1876 Location: California
|
Posted: Tue Jun 24, 2008 9:54 pm |
EDIT: Ninja'd by zscript. :P
#REGEX {^(?:\d+ \w+ \d+:\d+ - )?\w+ tells you '.*'} {#capture whatever}
That should do it for you.
Charneus |
|
|
|
 |
harley Apprentice
Joined: 05 Apr 2008 Posts: 121
|
Posted: Tue Jun 24, 2008 10:05 pm |
This works
but instead of #capture i use #win
I might have to change to #capture as what charn posted it only does the last letter in the persons name
figured it out with the convert to regex option :P thanks for the help guys |
|
|
|
 |
|
|
|