|
machina Newbie
Joined: 02 Jan 2007 Posts: 1
|
Posted: Tue Jan 02, 2007 9:30 am
Multiline trigger problem |
i'm going bonkers trying to figure out what is wrong with this regex. I have a regex setup to detect room names and exits for the mapper, but some other non-room related text was sometimes interfering so I'm trying to make it more accurate by recognizing the promp as well. The problem is there can be arbritarily any number of lines between the room name/exits and the prompt. A typical case is
-= Lance Street =- (n,s)
Wayhaven City Guard {4}.
Wayhaven City Guard Sergeant.
>
The regex I'm using is (.*)\s(\(.*\))\n(.*\n)*\>
This works fine when there is only one line between the exits and prompt e.g.
-= Lance Street =- (n,s)
Wayhaven City Guard Sergeant.
>
but it doesn't work with > 1 lines. ALso I've put this regex into a regex tester (Rx TOolkit) and it seems to think the pattern should match, so I'm confused :D
Can anyone shed some light on this?
Cheers |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Wed Jan 03, 2007 1:26 am |
Why not just use a multistate trigger?
#trig {-= Lance Street =- ~(n,s~)} {}
#cond {>} {} |
|
|
|
|
|