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
Scirkhan
Apprentice


Joined: 14 Sep 2007
Posts: 167
Location: aztx

PostPosted: Mon Jan 12, 2009 3:45 pm   

single space
 
how do you match a single space? or two spaces?

^ (*)
^ %x(*)
^ %x%s(*)

That's all I know. I don't know how to match a single space like ? matches a single character.
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Mon Jan 12, 2009 9:54 pm   
 
Use the spacebar. If that doesn't work, use the %s wildcard. It will match more than one space, of course, so if it's absolutely imperative that this trigger only work on single spaces you will want to surround that with parentheses and use the %len() to check before doing other things.
_________________
EDIT: I didn't like my old signature
Reply with quote
Leitia
Adept


Joined: 04 May 2007
Posts: 292
Location: Boston

PostPosted: Tue Jan 13, 2009 5:06 pm   
 
regex \s works for one space too, it is sometimes nice where you want to see a few spaces (\s\s\s) in a long match

You still have to check len to limit repetition though.

\s\s\s matches those spaces in the pipes in
Code:
"|   | "
and would match
Code:
" |   |"
(the pipes just show the matches in the example). That can be a problem without anchors, characters, or @len()
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