私は正規表現に非常に慣れていないため、学習しようとしていますが、かなり混乱しています。
私の目標は、特定の文字で始まる文字列のチャンクを取り出すことです。
後は全部返してほしい/images
例: URL:https://www.google.com/images/srpr/logo4w.png
返品したいもの:/images/srpr/logo4w.png
これが私の試みです:
var src = document.getElementById('image').getAttribute("src"),
regex = src.match(/images/i);
console.log(regex);