Re: starting position of RE match

2004-09-23 Thread Robert Citek
On Wednesday, Sep 22, 2004, at 08:05 US/Central, Jenda Krynicky wrote: Which means it's actually much easier than I had you believe: $s = "sasas dfgfgh asasas asedsase"; while ($s =~ /(?=sas)/g) { print "pos=",pos($s), " = '",substr($s,pos($s),3),"'\n"; } Bas

Re: starting position of RE match

2004-09-22 Thread Jenda Krynicky
From: Robert Citek <[EMAIL PROTECTED]> > On Tuesday, Sep 21, 2004, at 17:17 US/Central, Jenda Krynicky wrote: > > > > How about this: > > $s = "sasas dfgfgh asasas asedsase"; > > while ($s =~ /\G.*?(?=sas)./g) { > > print "pos=",pos($s)-1, " = '",substr($s,pos($s)-1,3),"'\n"

Re: starting position of RE match

2004-09-21 Thread Robert Citek
On Tuesday, Sep 21, 2004, at 17:17 US/Central, Jenda Krynicky wrote: How about this: $s = "sasas dfgfgh asasas asedsase"; while ($s =~ /\G.*?(?=sas)./g) { print "pos=",pos($s)-1, " = '",substr($s,pos($s)-1,3),"'\n"; } Thanks. Seems to work, although I'm stil

Re: starting position of RE match

2004-09-21 Thread Jenda Krynicky
From: Robert Citek <[EMAIL PROTECTED]> > Is there an equivalent for "index" that uses regular expressions > instead of exact string? > > I've been looking at index, pos, m//, and the corresponding "$" > variables but nothing I've found so far does what I'm looking for. > Specifically, what I'm t