tags:

views:

97

answers:

2

I am having a hard time figuring out the earliest version of perl where non-capturing parentheses are supported in regex patterns?

Can I take this feature for granted for all versions of Perl5?

+4  A: 

Some time before 5.003_07 according to perlre for that version.

eclark
Thank you. No wonder I could not find it in `perldelta` files.
Sinan Ünür
+10  A: 

I dug out Perl 5.000 from my archive CDs. It includes

=item (?:regexp)
This groups things like "()" but doesn't make backrefences like "()" does.

So it's in all versions of Perl 5. (It's definitely not in Perl 4 or earlier.)

cjm
I am impressed and amazed and disturbed that you had an archived CD with Perl 5.000 ;-)
Sinan Ünür
For extra disturbance, it was the OS/2 port, as that's what I was using back then. :-)
cjm
FYI, the typo you corrected wasn't mine. In 5.000, `perlre.pod` had "backrefences" in that sentence.
cjm
@cjm Reinserted the typo for historical accuracy.
Sinan Ünür
@Sinan: the history isn't secret and is available online http://perldoc.perl.org/index-history.html
Dummy00001
@Dummy00001 I was not able to locate a mention of when non-capturing parentheses added in any of the deltas, hence the question "Can I take this feature for granted for all versions of Perl5?"
Sinan Ünür