Regex: Strip HTML attributes except SRC

前端 未结 6 947
予麋鹿
予麋鹿 2020-12-16 17:13

I\'m trying to write a regular expression that will strip all tag attributes except for the SRC attribute. For example:

6条回答
  •  旧巷少年郎
    2020-12-16 17:28

    Posting to provide a solution for Oracle Regex

    <([^!][a-z][a-z0-9]*)([^>]*(\ssrc=[''''\"][^''''\"]*[''''\"]))?[^>]*?(\/?)>
    

提交回复
热议问题