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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
theOneAndOnlyMrT
Newbie


Joined: 15 May 2008
Posts: 3

PostPosted: Thu May 15, 2008 3:13 pm   

Regex Question...
 
I've been trying and trying and can't seem to figure this out. I've read a bunch of regex posts and am lost.

Here's example mud output:

Chrysoberyl - Catspaws: Catseye(T) Hairball(B) Litterbox(A)
or
Wow - Hammac: Whoo(A)
or
Yarl - Frazzle: Mermoon(A) Mersun(I)

So here's what I've come up with:

^(?systemname:\w+) - (?ownername:\w+):( (?planetname:\w+)\((?planettype:\a)\))+

I'm not exactly sure what I'm doing wrong. Can anyone try to help me? Thanks a million
Reply with quote
Fang Xianfu
GURU


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

PostPosted: Thu May 15, 2008 3:14 pm   
 
You may find this topic helpful, since it seems to be matching exactly the same text.

The trouble with using + in this way is which of the planets is going to end up in the variable, when there's more than one of them.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
theOneAndOnlyMrT
Newbie


Joined: 15 May 2008
Posts: 3

PostPosted: Thu May 15, 2008 3:16 pm   
 
Wow, thanks :)
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD 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