私は文字列のRegExをほぼ一日作成しようとしていますが、それでもまだ機能していません。引用符で値を抽出するためのRegexのヘルプpls
string example (double quotes are options, and can also be single quotes):
"234"? "<img src=\"http://abc.com/a.jpg\" onclick=\"alert(\"\"working with 'quotes'?\"\");\" />"
and the following groups should be extracted:
234
<img src="http://abc.com/a.jpg" onclick="alert(""working with 'quotes'?"");" />
希望があれば誰でも助けてください!
var s = "\"234\"? \"<img src=\"http://abc.com/a.jpg\" onclick=\"alert(\"\"working with 'quotes'?\"\");\" />\"";
var matches = s.match(/['"][\d]*['"](?=[\s]*\?)|['"]<[^><]*>['"]/ig);
最初の部分オプションのスペースと続く引用符の内側['"][\d]*['"](?=[\s]*\?)
試合番号:?
賭け区切り文字を "?"空白は最初の部分の場合は –
、後の部分の場合は "?"で区切られます。二重引用符は任意です –