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>:との間の文字列を正確に取得する必要があり ます。
</a>:
これを行うことで誰も頭を悩ませたくないのなら、私には理解できます。
これを一致させるには、ルックアラウンドを使用します。/(?<=<\/a>: ).*(?= )/
/(?<=<\/a>: ).*(?= )/
ただし、JavaScript は後読みをサポートしていないため、一致するグループを使用する必要があります。
var regex = /<\/a>: (.*?) /; var match = myString.match(regex); if (match) return match[1];