[Chris Angelico <ros...@gmail.com>]
> Is there any sort of standardization of regexp syntax and semantics,

Sure. "The nice thing about standards is that you have so many to
choose from" ;-) For example, POSIX defines a regexp flavor so it can
specify what things like grep do. The ECMAScruot standard defines its
own standard, ditto Java, etc.


> or does everyone just extend it in their own directions, borrowing
> ideas from each other to give some not-always-false assurance of
> compatibility?

In real life, everyone strives to copy what Perl does, because regexps
are ubiquitous in Perl and Larry Wall worked hard at the time to put
in every useful regexp feature everyone else already had, but with
more uniform syntax. Perl's love of regexps strikes me as clinically
pathological, but that doesn't diminish my respect for the relative
sanity Perl brought to this area.

There's a little bit flowing _into_ Perl too. An example close to my
heart: Guido and I obtained Larry's promise that he'd never use a (?P
prefix, so that Python could use that for its own purposes. Which
amounted to introducing the concept of named groups. Which Perl in
turn later adopted - although Perl dropped the "P" for named groups.

Ah - I see MRAB replied while I was typing this, saying much the same.
But I'm worider, so I won't waste the eff\ort ;-)
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/4SRZOOINXWEKCPNZDX2362O5P7XCGKMK/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to