Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save alejandrofloresm/b4ddcd0dd0bb049b8a595222ed13c7cf to your computer and use it in GitHub Desktop.
Save alejandrofloresm/b4ddcd0dd0bb049b8a595222ed13c7cf to your computer and use it in GitHub Desktop.
Some useful regex for sublime text

This is a collection of useful regex formulas that I have found on the internet, to be honest mainly on stackoverflow :) #Selection

Select everything inside brackets {}

\{[^}]*\}

Select everything between ""

(["'])(?:(?=(\\?))\2.)*?\1

The important part is that whenever you have something like <a href="#" target="_blank"> it will select # and _blank separately. Source: http://stackoverflow.com/questions/171480/regex-grabbing-values-between-quotation-marks

Select all mentions of indexes of an array

\@Localizer\["(.*?)"\]

Change the @Localizer for the name of your array. Source: http://stackoverflow.com/questions/171480/regex-grabbing-values-between-quotation-marks

Substituion

$0 = Matches the selected items

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment