List Info

Thread: regular expression format. Help!




regular expression format. Help!
user name
2006-01-23 22:49:43
Hi,

I am trying to create a regular expression that has a few
requirements.

1. The data must all digits
2. The data must be 9 digits in length
3. The data cannot have 9 zero's.  ex: '000000000'

I have 2 issues:
I am having problems trying to check for a total of 9 zeros.
 My all
zero check does not work. It will fail if there is a zero
anywhere in
the data.  Not sure how to specify 9 zero total.

I read in an tutorial that I could use '&&'
intersection operation. So
I was trying to check for 9 digits AND not 9 zeros.  But
when I test
the expression, it seems it does not recognize the
intersection.

I can't figure it out.

Does any one know if this is possible to handle with regular
expressions or has another idea to handle the expressions?

Thanks!

regular expression format. Help!
user name
2006-01-24 00:20:02
u never mentioned in what environment u r working and what
flavor of
regex u r using. This would work in .NET:

^(?!0)d$

it matches on 123456789
but does not match 000000000

tested in the regex tool
http://www.rege
xlib.com/RETester.aspx

regular expression format. Help!
user name
2006-01-24 15:46:20
Thanks so much for the help.  I am using Java, it works
wonderfully.

[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )