Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When were non-capturing parentheses added to Perl's regular expressions?

Tags:

syntax

regex

perl

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?

like image 412
Sinan Ünür Avatar asked Aug 08 '10 03:08

Sinan Ünür


1 Answers

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.)

like image 189
cjm Avatar answered Sep 20 '22 15:09

cjm