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.
私は文字列を持っていますasdf-zxcv-qwer-
asdf-zxcv-qwer-
前のハイフンが後の接頭辞として使用されているため、- 使用している間に/-[a-z]+-/出現するすべての単語を置き換えたいです。との両方に一致させる方法は?zxcvqwerzxcvzxcvqwer
-
/-[a-z]+-/
zxcv
qwer
チェックされているが消費されていない、後読み ( ) または先読みアサーション ( )のいずれかのアサーションを使用します。(?<=…)(?=…)
(?<=…)
(?=…)
/(?<=-)[a-z]+-/ /-[a-z]+(?=-)/