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
Fluffy
Newbie


Joined: 06 Jan 2008
Posts: 8
Location: Houston, TX

PostPosted: Sun Jan 20, 2008 3:43 pm   

Regex Subpatterns - Creating local variables?
 
Is there a way to create a local variable with a regular expression match? I know that you can create named variables (ie: &VarName = @VarName), like: (?varname:\d). However, I am not sure if theres a way to match a subpattern, and turn it into a local variable instead. If anyone knows how, please let me know! Thank you very much!!
Reply with quote
Fang Xianfu
GURU


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

PostPosted: Sun Jan 20, 2008 4:19 pm   
 
Should be working:

#trig {($omg:\w+)} {#say $omg} "" {regex}

Works in zScript patterns too.
_________________
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 » 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