问题描述:

^[A-Za-z0-9]*[A-Za-z0-9\f\t]$I tried using this, but it is not accepting strings with a space at the end. I am trying to make some server side validation using Regex for this case in Java.

网友答案:

Just add optional spaces at the beginning and at the end:

^\s*[A-Za-z0-9]+\s*$
网友答案:

This should work

\s+[\w\d]+\s+
相关阅读:
Top