Hi,
Could you please elaborate?
In your example:
nn nnnn nnnn - 10 digits
nnnnnnnnn - 9 digits
nnnn nnnn nnnnnn - 14 digits
Do you want all of the above to be matched?
Or are you looking to match exactly 10-digit long (including
spaces)
"words?"
(a) 9 9 9 7 8 9 0 1 2 3
(b) 9 99 7 890 1 2 3
(c) 9 9978 9 0 1 23
(d) 9997890123
(e) 9 9 9 7 8 9 0 1 2
(f) 9 9 9 7 8 9 0 1 2 3 1
[0-9]+ *[0-9]+ *[0-9]+ *[0-9]+ *[0-9]+ *[0-9]+ *[0-9]+
*[0-9]+ *[0-9]+
*[0-9]+ *
The above regex will match at most 10 digits, all except
(e)
A part of (f) will be matched, because it has 11 digits.
Specifically, do you want to match at least 10 digits, at
most 10
digits, or exactly 10 digits (interspersed with single space
or
spaces)?
Do you want to allow initial space(s)?
Thanks
Syd
On Aug 7, 12:37 pm, pc <ch... netspace.net.au> wrote:
> Hi,
>
> looking for regex for 10 digit numeric with or without
spaces
>
> eg
> nn nnnn nnnn
> nnnnnnnnn
> nnnn nnnn nnnnnn
>
> all valid
>
> cheers,
>
> eddiec
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Regex" group.
To post to this group, send email to regex googlegroups.com
To unsubscribe from this group, send email to
regex-unsubscribe googlegroups.com
For more options, visit this group at http://groups.go
ogle.com/group/regex
-~----------~----~----~----~------~----~------~--~---
|