Using regular expressions to find img tags without an alt attribute

前端 未结 8 1844
伪装坚强ぢ
伪装坚强ぢ 2021-01-30 11:37

I am going through a large website (1600+ pages) to make it pass Priority 1 W3C WAI. As a result, things like image tags need to have alt attributes.

What would be the

8条回答
  •  Happy的楠姐
    2021-01-30 12:11

    This worked for me.

    ^

    This matches any string beginning with that doesn't contain any number of characters before an alt attribute. It even works for src="" type of attributes.

提交回复
热议问题