develooper Front page | perl.perl5.porters | Postings from May 2003

Re: [perl #22182] regular expression bug (design limitation?)

Thread Previous | Thread Next
From:
Ilya Zakharevich
Date:
May 14, 2003 15:46
Subject:
Re: [perl #22182] regular expression bug (design limitation?)
Message ID:
20030514224630.GB23667@math.berkeley.edu
On Wed, May 14, 2003 at 03:07:05PM -0700, Edward Peschko wrote:

Sorry, I could not guess what you have in mind...

Yours,
Ilya

> I'd like to be able to define a coderef that looks like the following:
> 
> my $_coderef = sub { my ($text) = @_;
> 					# text starts from position at which regular expression last 
> 					# matched.
> 					# do something with $text, including regular expressions to modify
> 					# pos($text);
> 					# change pos so that the regular expression 'picks up' where the 
> 					# sub left off (ie: pos).
> 			}
> 
> Then people could write stuff to do particularly difficult regular expressions using 
> Inline::C, and you could say:
> 
> if ($varb =~ m"($balanced_parens)")  # is a C call.
> {
> 
> }
> 
> which IMO is far more intuitive (and cleaner) than anything to do with (?...).
> 
> Ed

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About