Because of your missing code tags, I can't really tell, but it seems your loop runs WHILE the re matches and not UNTIL it matches.
and you don't anchor (/^…$/) your RE so "this 123401-01-0123456 is not a date" as input will also match.
In reply to Re: Regular expression for date
by Skeeve
in thread Regular expression for date
by perlee
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |