我很想通过使用 Apples NSRegularExpressions 匹配和删除它们来摆脱 rssfeed 中的一些小图像。
<img src="somepic" height="1" width="1"> should be matched for removal
<img src="somepic" height="50" width="100"> -> should also be matched
<img src="somepic" height="100" width="100"> -> this one should not be matched
我目前的方法还没有奏效
<img(\s*[height|width]\s*=\s*"([0-9]|[1-9][0-9])"\s*+|[^>]+?)*>
我的猜测是捕获组存在一些问题(可能根本不需要)。有没有人暗示它为什么不工作?