in reply to MUMPS Array Subscripts Parsing Via RegEx
I'm also very intersted in anything you have to say about how (if at all) you can document or comment a Regular Expression, so it at least looks like commented modem noise instead of just modem noise.See perlre /x modifier.
Also, courtesy of YAPE::Regex::Explain, here is your /^((\^[%A-Za-z\d]+)($|=|\(bunch_of_ugly_subscripts\)))/ with comments:
UPDATE: Does this CPAN search help?(?x-ims: # group, but do not capture (disregarding # whitespace and comments) (case-sensitive) # (with ^ and $ matching normally) (with . not # matching \n): ^ # the beginning of the string ( # group and capture to \1: ( # group and capture to \2: \^ # '^' [%A-Za-z\d]+ # any character of: '%', 'A' to 'Z', 'a' # to 'z', digits (0-9) (1 or more times # (matching the most amount possible)) ) # end of \2 ( # group and capture to \3: $ # before an optional \n, and the end of # the string | # OR = # '=' | # OR \( # '(' bunch_of_ugly_su # 'bunch_of_ugly_subscripts' bscripts # \) # ')' ) # end of \3 ) # end of \1 ) # end of grouping
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: MUMPS Array Subscripts Parsing Via RegEx
by Clovis_Sangrail (Beadle) on May 16, 2012 at 14:31 UTC |