Skip to content

Instantly share code, notes, and snippets.

@thenbrent
Created April 16, 2012 04:43
Show Gist options
  • Select an option

  • Save thenbrent/2396366 to your computer and use it in GitHub Desktop.

Select an option

Save thenbrent/2396366 to your computer and use it in GitHub Desktop.
Regex to match WordPress i18Nn function with no text domain specified
(_e\(\s*'[^']*')(\s*)(?=\))(\))
(__\(\s*'[^']*')(\s*)(?=\))(\))
Or do them in both, also account for strings using "" instead of just '':
(_[e|_]\(\s*['|"][^,'"]*['|"])(\s?)(?=\))(\){1})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment