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
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5187

PostPosted: Sat Jun 21, 2008 12:54 pm   

[2.28] %quoteregex missing a few
 
Using the following command you will see the backslashes are inserted just about everywhere they should be. The spots that are missing are the |, {, and }.
#SHOW %quoteregex("abc.*?(xyz|)(?:d)[x]{7}\d+")
As it stands now it produces an alternation list, and in the second part the ] is being repeated 7 times.
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Mon Jun 23, 2008 4:39 pm   
 
Thanks! I'll add the { and } characters. However, I didn't want to add the | character because I wanted people to be able to call %quoteregex on a string list and still have it work as an alternation list.
Reply with quote
Zhiroc
Adept


Joined: 04 Feb 2005
Posts: 246

PostPosted: Tue Jun 24, 2008 5:02 am   
 
Hmm, I can see the usefulness of doing that... but... what if I need to quote the '|'? Then I have to go through extra trouble and do the substitution myself.

There should be either two functions, or an optional argument to select the behavior. (And yeah, I guess to preserve compatibility, you'd have to make the default to not do it).
Reply with quote
Taz
GURU


Joined: 28 Sep 2000
Posts: 1395
Location: United Kingdom

PostPosted: Tue Jun 24, 2008 11:14 am   
 
An argument is much better that two functions, just a simple true in order to quote the pipe and as you say a default of false.
_________________
Taz :)
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Tue Jun 24, 2008 6:49 pm   
 
I think I'm going to add an argument to both %quote and %quoteregex that allows you to specify additional characters to quote.
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