How do I do a regex search and replace in sublime text 2?

后端 未结 3 1438
南方客
南方客 2020-12-15 10:46

I want to remove inline style from an html document in ST2.

I imagine my regex will be something like this style=\\\"*\\\"

If that\'s wrong, it doesn\'t

相关标签:
3条回答
  • 2020-12-15 10:53

    Simply open the Search+Replace function (via Ctrl-H or the menu bar) and check the first box on the left of it (the one with an '*' on it, or you can press Alt+R)

    Then the search field will be used as a Regex, and you can use the found patterns using the usual $1, $2, $3 vars in the replace box

    More info here

    0 讨论(0)
  • 2020-12-15 10:55

    I had a similar task to perform, the regex I used in the manner that Nas62 suggested was

    style=\"(.*?)\"
    
    0 讨论(0)
  • 2020-12-15 11:15

    Find What : style=".*"

    Replace With : leave it as blank

    Click Replace All button.

    0 讨论(0)
提交回复
热议问题