How can I allow only one word(string) with javax.validation? Which regular expression can I use for @Pattern()
Fantastic news! We've Found the answer you've been seeking!
Question:
How can I allow only one word(string) with javax.validation?
Which regular expression can I use for @Pattern()
I'm not looking for matching the word
I want to allow only single word for input with no white space
Possible input: cat, dogs, bird, tree, moon --> they are all one word
Input with more than single word or sentence is not allowed e.g.) a cat, two dogs ---> they are two words so I don't want to allow them as a user input
Please suggest using @Pattern() rather than other method
Thank you
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date: