[erlang-questions] builtin regexp functions in Erlang/OTP R12B-3
Mon Jun 16 21:31:39 CEST 2008
2008/6/16 Tony Finch <>:
> On Mon, 16 Jun 2008, Robert Virding wrote:
> > One quick comment is that I wonder if not part of the problem with PCRE
> > Perl regular expressions is that in one respect they are integrated into
> > Perl and contain features to interact with the rest of Perl. If I
> > correctly, for example, you can set Perl variables directly from the RE.
> > this what became the named subexprs in PCRE?
> Named subpatterns came to PCRE from Python. There isn't a syntax for
> setting arbitrary Perl variables from a subpattern (nor is there in
> Python). In perl-5.10, which is the first version that supports named
> subexpressions, the named captures become values in a hash table. In
> Python the MatchObject result has a group() method for accessing captures
> by number or name.
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.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions