 |
sav Wanderer
Joined: 09 Jan 2006 Posts: 86
|
Posted: Sun Aug 23, 2009 10:16 am
Some regex help please. |
Hi, i'm trying to make a regex trigger to capture the prompt of the monster when i'm fighting and when i'm not and differs when i'm fighting different monsters.
[:]
[E:monname:monhealthword]
[E:monname:monhealthnumber%]
[E:monname monname2:monhealthword]
[E:monname monname2:monhealthnumber%]
[E:monname monname2 :monhealthword]
[E:monname monname2 :monhealthnumber%]
basically, i want to capture monname or monname monname2(with and without the space after monname2) into 1 variable, and monhealthword or monhealthnumber% into another variable.
thanks! |
|
|
|
 |
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Mon Aug 24, 2009 7:56 pm |
Here's my quick try:
| Quote: |
[(?:E\:)?(.*):(.*)]
|
Then just do %trim(%1) to get rid of extra whitespace after monname2, if any. The monster names will be in %1, the health value in %2. If you are not fighting (I presume that is the situation with "[:]"), %1 and %2 will be blank. |
|
|
|
 |
sav Wanderer
Joined: 09 Jan 2006 Posts: 86
|
Posted: Mon Aug 24, 2009 10:06 pm |
nope, that doesn't work. =(
and yeah, when i'm not fighting, its [:]. |
|
|
|
 |
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Tue Aug 25, 2009 3:54 pm |
Hm, my backslashes seem to have been dropped somehow. Oh, I used quote, instead of code. Try this:
| Code: |
\[(?:E\:)?(.*):(.*)\]
|
|
|
|
|
 |
|
|
|