Skip to content

Instantly share code, notes, and snippets.

@mattjbayly
Created December 7, 2016 00:04
Show Gist options
  • Save mattjbayly/70ab715bc5bcf15a19a0700cd51bf004 to your computer and use it in GitHub Desktop.
Save mattjbayly/70ab715bc5bcf15a19a0700cd51bf004 to your computer and use it in GitHub Desktop.
################################################
# Match two strings in any order:
'hi jack here is james'
'hi james here is jack'
^(?=.*\bjack\b)(?=.*\bjames\b).*$
################################################
# Match two strings with anything in between:
'hi jack here is james'
'hi jack08098kljjjames'
jack[^\r\n]james
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment