2008/6/16 Tony Finch <<a href="mailto:dot@dotat.at">dot@dotat.at</a>>:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="Ih2E3d">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><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>