I'm using <f:validateRegex pattern="[a-zA-Z]*"/>
for ensuring that entered values contain alphabet only, it is working fine but it is not allowing to take space in the string.
How can i incorporate space character in above pattern?
Thanks in advance.
Simply add the space to the regex.
<f:validateRegex pattern="[a-zA-Z ]*"/>
If you wanted any whitespace, not just space, swap the space with \s
.
<f:validateRegex pattern="[a-zA-Z\\s]*"/>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With