LoginSignup
0
0

More than 5 years have passed since last update.

pattern要素の使い方(正規表現を属性に入力する場合)

Last updated at Posted at 2018-04-15

特定の文字を含む

pattern = "^[a-zA-Z0-9 ]+\\S$$"

「^...」は「...で始まる」という意味。
「[a-zA-Z0-9 ]」は「小文字・大文字の全角アルファベット、全角数字を含む」という意味。
「...+」は「...を一回以上含む」という意味。
「\S$」は「空白文字(半角スペース、全角スペース、タブ、改行、改ページ)で終わらない」という意味。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0