[Israel.pm] match second

Tal Kelrich tal at musicgenome.com
Wed Jun 21 04:38:21 PDT 2006


Quick and dirty, $off contains offset of match end character +1

my $foo="aaa  b c dddd e f g fghfdg dfhdf aaa dfhdfh dfhdfh ";
my $matched=$foo=~/a{3}.*?(a{3})/;
$off=$+[0];


On Wed, 21 Jun 2006 14:23:42 +0300
"Ernst, Yehuda" <yernst at nds.com> wrote:

>  
> the offset from the start of the second one
> 
> ________________________________
> 
> From: perl-bounces at perl.org.il on behalf of Tal Kelrich
> Sent: Wed 6/21/2006 2:02 PM
> To: perl at perl.org.il
> Subject: Re: [Israel.pm] match second
> 
> 
> 
> On Wed, 21 Jun 2006 12:29:43 +0300
> "Ernst, Yehuda" <yernst at nds.com> wrote:
> 
> > if string  contains    aaa      twice i want to know the place of
> > the second one. if no twice  nothing
> 
> What do you mean by place?
> offset in string? the rest of the string that surrounds it?
> 
> --
> Tal Kelrich
> PGP fingerprint: 3EDF FCC5 60BB 4729 AB2F  CAE6 FEC1 9AAC 12B9 AA69
> Key Available at: http://www.hasturkun.com/pub.txt
> ----
> We were so poor we couldn't afford a watchdog. If we heard a noise at
> night, we'd bark ourselves. -- Crazy Jimmy ----
> *** NDS IL IT scanned this email for malicious content ***
> *** IMPORTANT: Do not open attachments from unrecognized senders  *** 
> 
> ***********************************************************************************
> This email message and any attachments thereto are intended only for
> use by the addressee(s) named above, and may contain legally
> privileged and/or confidential information. If the reader of this
> message is not the intended recipient, or the employee or agent
> responsible to deliver it to the intended recipient, you are hereby
> notified that any dissemination, distribution or copying of this
> communication is strictly prohibited. If you have received this
> communication in error, please immediately notify the
> postmaster at nds.com and destroy the original message.
> ***********************************************************************************
> 
> _______________________________________________
> Perl mailing list
> Perl at perl.org.il
> http://perl.org.il/mailman/listinfo/perl


-- 
Tal Kelrich
PGP fingerprint: 3EDF FCC5 60BB 4729 AB2F  CAE6 FEC1 9AAC 12B9 AA69
Key Available at: http://www.hasturkun.com/pub.txt
----
Don't kiss an elephant on the lips today.
----
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 191 bytes
Desc: not available
Url : http://perl.org.il/pipermail/perl/attachments/20060621/05942418/attachment.pgp 


More information about the Perl mailing list