If you look in perldoc perlre, there is many more strange features in perl "regular" expressions. For example:<br>"branch reset" (?|pattern) - fix backrefs numbers after this group<br>"call to perl code" (?{ code }) - very good joke :-)<br>
"code generated pattern" (??{ code }) - dtto<br>"parentheses back referencing" (?PARNO) - as previous, very good for making recursive patterns<br>conditional patterns and more and more. I like it, but I argue don't implement it any more outside perl world :-)<br>
<br>In result, perl regular expressions are very irregular.<br><br><div class="gmail_quote">2008/6/16 Robert Virding <<a href="mailto:rvirding@gmail.com">rvirding@gmail.com</a>>:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
2008/6/16 Tony Finch <<a href="mailto:dot@dotat.at" target="_blank">dot@dotat.at</a>>:<br><div class="gmail_quote"><div class="Ih2E3d"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

<div>On Mon, 16 Jun 2008, Robert Virding wrote:<br>
<br>
> One quick comment is that I wonder if not part of the problem with PCRE and<br>
> Perl regular expressions is that in one respect they are integrated into<br>
> Perl and contain features to interact with the rest of Perl. If I remember<br>
> correctly, for example, you can set Perl variables directly from the RE. Is<br>
> this what became the named subexprs in PCRE?<br>
<br>
</div>Named subpatterns came to PCRE from Python. There isn't a syntax for<br>
setting arbitrary Perl variables from a subpattern (nor is there in<br>
Python). In perl-5.10, which is the first version that supports named<br>
subexpressions, the named captures become values in a hash table. In<br>
Python the MatchObject result has a group() method for accessing captures<br>
by number or name.</blockquote></div><div><br>Then I am at least partially right, not variables but keys in table. Still you can access them by name anyway which means that the name exporting from the regexp into the surrounding programs works. <br>

<br>Robert<br></div></div><br>
<br>_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://www.erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://www.erlang.org/mailman/listinfo/erlang-questions</a><br></blockquote></div><br><br clear="all"><br>-- <br>--Hynek (Pichi) Vychodil