テキストボックスフィールドがあり、入力内容を規制したい.
ユーザーに 6 ~ 10 文字を多かれ少なかれ入力させたくありません。これが文字を制限するための正規表現です ^.{6,10}$ この部分は機能しましたが、ユーザーに空白 (スペース) を入力させたくありません。入力の最初と最後から空白を検出できるようになりましたが、ユーザーがテキストの途中でスペースを入力した場合は検出できません。例を参照してください。
" testing" = regulator detects the space in the beginning. regex i use ^[^\s].+[^\s]$
"testing " = regulator detects the space in the end. regex i use here is same as abow
"test ing" = regulator does not detect the space in the middle. tried different regex with no luck.
必要なすべてを実行するレギュレーターを作成するにはどうすればよいですか?