Skip to content

Instantly share code, notes, and snippets.

@pragyanatvade
Created July 5, 2015 12:04
Show Gist options
  • Save pragyanatvade/142aa4780bf1a5abe738 to your computer and use it in GitHub Desktop.
Save pragyanatvade/142aa4780bf1a5abe738 to your computer and use it in GitHub Desktop.
Regular Expressions

Starts with: abc Ends with: xyz Contains: 123 Doesn't contain: 456

  1. OR /^abc|xyz$|123|^(?:(?!456).)*$/

  2. AND /^(?=^abc)(?=.*xyz$)(?=.*123)(?=^(?:(?!456).)*$).*$/

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