Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
machina
Newbie


Joined: 02 Jan 2007
Posts: 1

PostPosted: 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
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Wed Jan 03, 2007 1:26 am   
 
Why not just use a multistate trigger?

#trig {-= Lance Street =- ~(n,s~)} {}
#cond {>} {}
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net