And what you are doing just doesn't exists as you think:\d ## means 1 digit. \d\d ## means 2 digits. \d+ ## means 1 or more digits \d{2,} ## 2 or more \d{3} ## means 3 digits.
Actually your REGEXP doesn't compile! I just don't know from where you got the idea of \d+ with {4} after it. And when you use it right you put a lot of \d before it: \d\d\d\d{4}. Note that "\d\d" already means 2 digits, and \d\d\d\d already means what you want (check if the string have only 4 digits) but you put {4} in the last, what means 7 digits!\d+{4} ## means one or more digits and the text "{4}".
See perlre, and don't forget that perldoc.com is your friend, so, you can call it every time.
Good luck.
Graciliano M. P.
"Creativity is the expression of the liberty".
In reply to Re: Regular Expression from Hell
by gmpassos
in thread Regular Expression from Hell
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |