PyWart: Python regular expression syntax is not intuitive.

Rick Johnson rantingrickjohnson at gmail.com
Wed Jan 25 12:33:55 EST 2012


On Jan 25, 11:16 am, Rick Johnson <rantingrickjohn... at gmail.com>
wrote:

> {!()...} or (!...) # Non Capturing.

Yuck: on second thought, i don't like {!()...}, mainly because non-
capturing groups should use the parenthesis delimiters to keep the API
consistent. Try this instead --> (!:...)

> {NG=identifier...}  # Named Group Capture
> {NG.name}  # Named Group Reference

...should be {NG.identifier}. I am also feeling like named group
syntax could be more simplistic without sacrificing readability.

{=identifier...}  # Named Group Capture
{.identifier}  # Named Group Reference




More information about the Python-list mailing list