
[Chris Angelico <rosuav@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 ;-)