On Mon, Aug 28, 2000 at 06:05:03PM -0400, Mark-Jason Dominus wrote:
> # WRONG
> while (($mo, $dy, $yr) = ($string =~ /\d\d-\d\d-\d\d/g)) {
> ...
> }
I assume you mean:
while (($mo, $dy, $yr) = ($string =~ /(\d\d)-(\d\d)-(\d\d)/g)) {
...
}
Drawing on some of the proposals for extended 'for' syntax:
for my($mo, $dy, $yr) ($string =~ /(\d\d)-(\d\d)-(\d\d)/g) {
...
}
This still requires that you know how many () matching groups are in
the RE, of course. I don't think I would consider that onerous.
I agree that REs currently have a somewhat confusing mass of behaviors,
depending on context and the /g option. I'm not certain if this can
be fixed without adding still more RE /options (and more confusion),
or more verbosity.
Do you have specific suggestions on how REs could be made "more
orthogonal"?
- Damien
- RFC 110 (v3) counting matches Perl6 RFC Librarian
- Re: RFC 110 (v3) counting matches Jonathan Scott Duff
- Re: RFC 110 (v3) counting matches Tom Christiansen
- Re: RFC 110 (v3) counting matches Jarkko Hietaniemi
- Re: RFC 110 (v3) counting matches Jarkko Hietaniemi
- Re: RFC 110 (v3) counting matches Mark-Jason Dominus
- Re: RFC 110 (v3) counting matches Nathan Wiger
- Re: RFC 110 (v3) counting matche... Mark-Jason Dominus
- Re: RFC 110 (v3) counting matches Damien Neil
- Re: RFC 110 (v3) counting matche... Mark-Jason Dominus
- Re: RFC 110 (v3) counting matches Philip Newton
- Re: RFC 110 (v3) counting matche... Mark-Jason Dominus
- Re: RFC 110 (v3) counting ma... Bart Lateur
- Re: RFC 110 (v3) countin... Mark-Jason Dominus
- $& and copying: rfc ... Uri Guttman
- Re: $& and copying: ... Mark-Jason Dominus
- Re: $& and copying: ... Tom Christiansen
- Re: $& and copying: ... Mark-Jason Dominus
- Re: $& and copying: ... Mark-Jason Dominus
