Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Struts
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
Struts
Validator RegExp for Telephone
Wagner Danda Da Silva Filho
Ranch Hand
Posts: 80
posted 18 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi All,
I need a help to create a regular expression to validate telephone field with
Struts
Validator. The regexp should be very simple: 4 numeric digits, a "-" char, and again more 4 numeric digits. Ex: "3131-3131".
Any ideias?
SCJP, SCWCD
Wagner Danda Da Silva Filho
Ranch Hand
Posts: 80
posted 18 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
I found this solution:
\d{4,4}-\d{4,4}
In struts validation.xml:
<field property="phone" depends="required,mask">
<arg0 key="client.phone"/>
<var><var-name>mask</var-name>
<var-value>^\d{4,4}-\d{4,4}$</var-value></var>
</field>
Wagner Danda
SCJP, SCWCD
Did you see how Paul
cut 87% off of his electric heat bill with 82 watts of micro heaters
?
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Check if a number contains all same digits using regular expression
Regular expression for allowing space, . , @ ,_ and , -
Validating user input: checking for illegal characters
Java regexp
Java Grammer/ Reg Ex For method identification
More...