Last Updated: February 25, 2016
·
4.066K
· hi_dm

Highlight everything between quotes in Sublime Text 2

In this example, I want to change all classes within a list item:

<li class="some-string">

Within Sublime Text 2 we can employ the following regular expression to attack to this:

([""'])(?:(?=(\\?))\2.)*?\1
  1. ⌘F (Control + F for PC)
  2. Activate regular expressions by looking for .* button (bottom left)
  3. Type class=([""'])(?:(?=(\?))\2.)*?\1>
  4. ⌥⏎ (option or alt + return)