誰かが Vimeo サムネイル URL で次のパターンを抽出するのを手伝ってくれませんか:
「406/278/406278075」から:
" http://b.vimeocdn.com/ts/406/278/406278075_640.jpg "
このために独自の正規表現を作成しようとしましたが、取得できません。
ご協力いただきありがとうございます。
誰かが Vimeo サムネイル URL で次のパターンを抽出するのを手伝ってくれませんか:
「406/278/406278075」から:
" http://b.vimeocdn.com/ts/406/278/406278075_640.jpg "
このために独自の正規表現を作成しようとしましたが、取得できません。
ご協力いただきありがとうございます。
(?:[0-9]+/?)+(?=_)
(?: = open non-capturing subpattern
[0-9]+ = digit, one or more times
/? = possibly followed by a forward slash
) = close non-capturing pattern
+ = the preceding non-capturing subpattern, one or more times
(?= = open look ahead assertion:
_ = the pattern must be followed by an underscore
) = close look ahead assertion
~
区切り文字としてチルダを使用する場合:
~(?:[0-9]+/?)+(?=_)~
または、区切り文字としてスラッシュを使用します。
/(?:[0-9]+\/?)+(?=_)/
注:今回は、パターンのスラッシュをエスケープする必要があります。
私が見つけた最も簡単で互換性のあるもの。私は正規表現の専門家ではありません。
[0-9_]+(?!..jpg$)
次に、それは一致配列の最後の値です。