Skip to content

Instantly share code, notes, and snippets.

@richjenks
Created April 16, 2016 07:45
Show Gist options
  • Save richjenks/8269902ccbc5be1f1e3044db1535c1cf to your computer and use it in GitHub Desktop.
Save richjenks/8269902ccbc5be1f1e3044db1535c1cf to your computer and use it in GitHub Desktop.
Regex Curriculum

Basics

  • Text match
  • Asterisks & Pluses
  • Question Marks
  • Pipe Options
  • Character Groups
  • Character Ranges
  • Range Shorthand
  • Counting Characters
  • Replacement

Common Patterns

  • Dates & Times
  • Marketo embed parts
  • Log parsing

Special Characters

  • . The dot matches any single character.
  • \n Matches a newline character (or CR+LF combination).
  • \t Matches a tab (ASCII 9).
  • \d Matches a digit [0-9].
  • \D Matches a non-digit.
  • \w Matches an alphanumberic character or hyphen.
  • \W Matches a non-alphanumberic character.
  • \s Matches a whitespace character.
  • \S Matches a non-whitespace character.
  • \ Use \ to escape special characters. For example, . matches a dot, and \ matches a backslash.
  • ^ Match at the beginning of the input string.
  • $ Match at the end of the input string.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment