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.
一致する正規表現をどのように書くことができますか、
アンダースコア「_」を含まない文字列。
/^[^_]*$/
[^] 構文は、「これらの文字を含めない」ことを意味します。
使用するアンダースコアではない文字に一致させるには[^_]( ^"not" を意味します)。したがって、文字列全体に一致させるには、次のようにします。
[^_]
^
/[^_]+/