jakarta-oro-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel F. Savarese" <...@savarese.org>
Subject Re: m//g and pos
Date Tue, 19 Feb 2002 20:26:01 GMT

In message <3C72AFD3.F68636F4@Sun.COM>, Michael Davey - Sun UK Support Engineer
 writes:
>I would also like to do...
>
>$grafitto = "fee fie foe foo";
>pos $grafitto = 4; # Skip the fee, start at fie
>while( $grafitto =~ m/e/g ) {
>    print pos $grafitto, "\n";
>}
>
>I guess I could get a substring and do work with that,
>adding 4 to all the results.

pmi.setInput("fee fie foe foo");
pmi.setCurrentOffset(4);  // or pmi.setBeginOffset(4) depending on what
                          // you really mean (i.e, how you want ^ to behave).
while(perl.match("m/e/", pmi)) {
    System.out.println(pmi.getMatchEndOffset());
}



--
To unsubscribe, e-mail:   <mailto:oro-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:oro-dev-help@jakarta.apache.org>


Mime
View raw message