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.
現在、アンダースコアを許可する正規表現があります。ハイフンを追加するにはどうすればよいですか?
これが私が現在持っているものです。
^(\w+)[/]*$
* $はアンダースコアに等しいと私は信じていますか?
この正規表現を使用できます:
^([\w-]+)/*$
そして、アンダースコアがあり\wます。これは、すべてのアルファベット、すべての数字、およびアンダースコアを含む単語文字を意味します。
\w