commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bakul Kumar" <bakul.ku...@gmail.com>
Subject Validation Reg ex of ( ).
Date Mon, 02 Jul 2007 12:23:27 GMT
Hi,

I want to validate the telephone number. I want to allow 0-9, *, +,-,(,
SPACE and ).
That means it should allow : (240) 643-9325

For that I tried :
                <var>
                    <var-name>mask</var-name>
                    <var-value>^[0-9()x+. -]*$</var-value>
                </var>

This is working fine. But, I don't have any control in RegEx to check
whether user has entered valid set of '(' and ')'. I mean, its allowing  :
(240( 643-9325 as a valid number.

If you have an idea of how to check the sequece of brackets '(' and ')'.
Please share it with me.

regards,
Bakul.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message