in reply to Regexp problem
Maybe you miss the anchors? Put ^ at the beginning and $ at the end of the regex. Also using ? instead of * might be desirable not to match strings like 12-12-12-12-12-12-12.perl -E ' $R = qr/\d{2}[-._]\d{2}([-._]\d{2})*/; say "$_ ", /$R/ ? "Y" : "N" for qw/1-2 1-20 11.20-1 11.20 12_30.99 + 000_00_000/'
|
|---|