QRegExp用法:如何从html字符串中获取图像名称


html = ... <span>emoticon12</span><img src="qrc:resemoticonemo12.gif" width="20" height="20"/><span>emoticon8</span><div>...</div><img src="qrc:resemoticonemo8.gif" width="20" height="20"/>...<img src="qrc:resemoticonemo9.gif" width="20" height="20"/>...

如何使用html中的QRegExp将所有图像名称获取为QStringList?

result=emo12.8gif,emo8.gif,emo9.gif

我不会做正则表达式。

在这种情况下,您可以使用以下模式解析它们:(匹配在第一个捕获组中(

(w+.w+)"

演示:https://regex101.com/r/gAzPJo/1/

最新更新