in reply to regex and embedded perl code

Another problem is your not conditionally assigning on a match. I got bitten by this myself once (Regex Capturing: Is this a bug or a feature?)

Say on the second pass, you feed it the string

"2001-4 foo bar"

The result will be

"1-11-12"

as you're blindly assigning. Even better, pass it "" the second time around and you'll get

2004-11-12


-Lee

perl digital dash (in progress)