Well, one problem is neither of your regex will match your string; the first will match strings which include 0-9 seven times in succession; the second will match seven consecutive copies of 0-9 or 0- or any combination of these; neither will match 7 random digits.
First suggestion: read the Perl documentation. Your regex are valid, but won't do what you want. Second, and more helpful suggestion try: /^\d{7}$/; which will match all strings which comprise exactly seven digits, with no non-numeric characters.gOn's insertion of code tags made my entire reply nonsense
emc
When in doubt, read the directions.
Visit NetlibIn reply to Re: Regular expression
by swampyankee
in thread Regular expression
by ashok
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |