Skip to content

Instantly share code, notes, and snippets.

@kevinhooke
Created September 16, 2019 23:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kevinhooke/8b6e990bf2f1a8a60ac7da598eaedbb2 to your computer and use it in GitHub Desktop.
Save kevinhooke/8b6e990bf2f1a8a60ac7da598eaedbb2 to your computer and use it in GitHub Desktop.
MacOS and Perl Compatible Regular Expressions (PCRE)
See https://www.unix.com/unix-for-advanced-and-expert-users/131088-grep-character-classes-w-d.html
Perl character classes like \w, \d are not supported by default in MacOS BSD style utils like grep, use POSIX classes
instead:
\w == [:alpha:]
[\w\d] == [:alnum:]
\d == [:digit:]
[\s\t] == [:blank:]
Also see: https://www.regular-expressions.info/posixbrackets.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment