S
stephenfu1
Hi,
I wish to use the struts validator framework but i'm having trouble
with the regular expression
I want the field to be:
-Only allowed characters are alpha, apostrophe, full stop, hypen or
space
-First character to be A-Z
-Last character not to be punctuation
-Consecutive punctuation are not allowed
-Consecutive spaces are not allowed
I've been trying to build from [A-Z]([A-Za-z]|['-. ?])[A-Za-z]$
That doesn't work because its enforcing the string to be 3 characters.
If i start trying to use * then i run into problems of encforcing no
consecutive punctuation / spaces
Anyone any ideas? Any help would be appreciated.
Thanks
I wish to use the struts validator framework but i'm having trouble
with the regular expression
I want the field to be:
-Only allowed characters are alpha, apostrophe, full stop, hypen or
space
-First character to be A-Z
-Last character not to be punctuation
-Consecutive punctuation are not allowed
-Consecutive spaces are not allowed
I've been trying to build from [A-Z]([A-Za-z]|['-. ?])[A-Za-z]$
That doesn't work because its enforcing the string to be 3 characters.
If i start trying to use * then i run into problems of encforcing no
consecutive punctuation / spaces
Anyone any ideas? Any help would be appreciated.
Thanks