[1-9]\d{3}-\d{3}
Ought to do it, I would think. It checks out in my RegEx checker, anyway,
using the examples you give.
Peter
> Hello,
>
[quoted text clipped - 13 lines]
> Thanks,
> Miguel
Peter Bradley - 12 Jun 2007 16:44 GMT
Sorry to reply to myself, but I miscopied my RegEx. It should, of course,
be:
^[1-9]\d{3}-\d{3}$
Since I'm assuming you want simply this format and nothing else. If you
leave the start and finish markers (^, $) out then it will match the format
anywhere in the expression.
e.g. 2222abd1234-023xxxx would match
Apologies
Peter
> [1-9]\d{3}-\d{3}
>
[quoted text clipped - 20 lines]
>> Thanks,
>> Miguel
> Could someone help me out?
[1-9][0-9][0-9][0-9]-[0-9][0-9][0-9]
I'm sure there are much shorter and cleverer ways using groups etc...

Signature
http://www.markrae.net