Skip to content

Instantly share code, notes, and snippets.

@unrevised6419
Last active August 6, 2019 15:58
Show Gist options
  • Save unrevised6419/c5c18e3a49a413a123c1101313b3d691 to your computer and use it in GitHub Desktop.
Save unrevised6419/c5c18e3a49a413a123c1101313b3d691 to your computer and use it in GitHub Desktop.
Grep l10n labels from project
grep -rhosP "(?<=l10n\(\')([\w\.]+)(?=\'\))" src/
  • -r recursive in nested folders and files
  • -h don't show file names
  • -o print only matches
  • -s silent errors
  • -P activate advanced perl regex
  • (?<=l10n\(\') must start with l10n(' but don't include in match
  • ([\w\.]+) match any word character or dot and include in match
  • (?=\'\)) must end with ') but don't include in match
  • src/ fodler where to search

Input

<ContentTitle className="my-4 text-white">{l10n('auth.signIn.title')}</ContentTitle>
...
placeholder={l10n('auth.signIn.enterPassword')}

Output

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