[Issue 9390] Option for verbose regular expressions

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Jan 25 12:13:47 PST 2013


http://d.puremagic.com/issues/show_bug.cgi?id=9390


Dmitry Olshansky <dmitry.olsh at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dmitry.olsh at gmail.com


--- Comment #1 from Dmitry Olshansky <dmitry.olsh at gmail.com> 2013-01-25 12:13:45 PST ---
How about adding the common extensions that is called comments inside regular
expression.

I can't recall synatx off-hand but it's something like:
(?# some comment that is ignored)


Plus you can already use any of the follwoing:

auto pattern - r"the first piece" // comment
r"the second piece" //comment 2
...
r" the last piece"; //last comment


Or if implicit concatenation feels too dirty:

auto pattern - r"the first piece"  // comment
~ r"the second piece" //comment 2
...
~ r" the last piece"; //last comment

Either way free-form regex + top-level explanatory note is enough by my
standards. The rationale is if you have to explan every piece in isolation then
it's one of 2 cases: you are explaning machanics to people that don't know what
regex is (and it's wrong) or the regex pattern is too darn complex for its own
good.

Since this is enhancement request I hereby propose 2 ways to solve it: close as
won't fix or add the aformentioned extension for comments (that at least is
more or less common). I'm not going to add another option that messes with
syntax rules.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list