superman wrote:
> Hello,
>
> I want a regex for matching a 10 digit number with
optional '*' and '?'
> characters for wildcard searches. The * or ? can not
appear in
> beginning if alone.
you question is not very clear. Do you mean the * or ? can
not be
stand-alone, and it can be the first character if they are
not
standaloe, like *123
> I came up with following regex but unfortunately doesnt
work all the
> time. Could anyone please correct me where I am wrong.
>
>
^\d(\b(\d+\*\d+)*|(\d+\?\d+)*|(\d*\*$)|(\d*\?$)
b)+
why do you want word boundaries. They look strange and most
possibly, I
think, they will fail many of your matches.
Can you provide us with some samples, i.e. are some of the
following
strings valid:
*
?*
***
*12*34
1234*
12*34?
12?3*4
123?**4
___
Xicheng
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---
|