I'm using <f:validateRegex pattern="[a-zA-Z]*"/> for en开发者_Python百科suring that entered values contain alphabet only, it is working fine but it is not allowing to take space in the string.
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]*"/>
This worked for me. It includes spaces in text at the start/ end of words.
/^[a-zA-Z ]+$/
I'm used this [a-zA-Z_ ]* its working for me
加载中,请稍侯......
精彩评论