in reply to Code in regexp
Here's another way of doing it:
/^(\d)(?{local ($x, $c) = ($^N, 0)}) ((\d)(?(?{$c ++; $^N == $x + $c})|\A))+$/x
Abigail
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Code in regexp
by demerphq (Chancellor) on Nov 28, 2002 at 19:46 UTC | |
by Abigail-II (Bishop) on Nov 29, 2002 at 09:50 UTC | |
by demerphq (Chancellor) on Nov 29, 2002 at 11:33 UTC | |
by Abigail-II (Bishop) on Nov 29, 2002 at 12:18 UTC | |
|
Re: Re: Code in regexp
by Jasper (Chaplain) on Nov 29, 2002 at 11:06 UTC | |
by Jasper (Chaplain) on Dec 12, 2002 at 16:27 UTC |