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.
文字列を正規表現で制御したいのですが、これにはaとz(大文字でもかまいません)と";"の間に文字が含まれている必要があります。char。(空白を含むazと ";"のみ)。私の正規表現はどうあるべきですか?
REエンジンに依存しますが、次のようなものを探しているでしょう。
^[a-zA-Z;\s]*$
または、少なくとも1つの文字が必要な場合は、+代わりに使用します。*
+
*
この正規表現を使用できます:[a-zA-Z; \ s] *
この正規表現は /[a-zA-Z;\s]*/