 |
Vijilante SubAdmin

Joined: 18 Nov 2001 Posts: 5187
|
Posted: 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 |
|
|
 |
Zugg MASTER

Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: 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.
|
|
|
 |
Zhiroc Adept
Joined: 04 Feb 2005 Posts: 246
|
Posted: 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). |
|
|
 |
Taz GURU
Joined: 28 Sep 2000 Posts: 1395 Location: United Kingdom
|
Posted: 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 :) |
|
|
 |
Zugg MASTER

Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: 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.
|
|
|
 |
|
|