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
Grumpy
Beginner


Joined: 24 May 2004
Posts: 10

PostPosted: Sat Apr 22, 2006 11:16 pm   

Regex help.
 
I'm trying to match a line which looks something like this:

[ Ogre ] <PK> [KNIGHT] Thandaeus Grogellehorn the Vengeance of the Forest

[ Elf ] <PK> (Outcast) (Wanted) Camthalion Miriel the Holy Patriarch of Healing


Here is my Regex Expression:

<PK> (?:[\a*])? (?:\(\a*\))* (\a*)

I'm trying to capture the name of the characters. But for some reason the optional match * and ? does not work and Zmud does not match unless both [word] and (word) is present on the same line. Does anyone know the reason for this?
Reply with quote
Tech
GURU


Joined: 18 Oct 2000
Posts: 2733
Location: Atlanta, USA

PostPosted: Sun Apr 23, 2006 2:28 am   
 
Try this
Code:
<PK> (?:\(\a*\) )*(?:\[\a*\] )*(\a*)

_________________
Asati di tempari!
Reply with quote
Grumpy
Beginner


Joined: 24 May 2004
Posts: 10

PostPosted: Sun Apr 23, 2006 2:44 am   
 
Thanks, that worked.
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