Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
番号のみを受け入れるmobileNumber のこの正規表現があり"[1-9][0-9]*"ます。 ただし、先頭にオプションの + が必要です。ただし、先頭に + を入力することはできません。 例えば。+9089098909 例。9089098909 例: +919089098909 また、13 文字まで受け付けます。 私はこれに取り組んでいます。誰でもこれを修正する方法を教えてもらえますか?
"[1-9][0-9]*"
\+?正規表現の先頭に置きます。
\+?
で正規表現を指定し^\+?\d{,13}$ます。これにより、数字が 13 桁を超えないようにし、先頭にオプションの + を付けることができます。
^\+?\d{,13}$