tools.regex-cheatsheet.title

tools.regex-cheatsheet.description

tools.regex-cheatsheet.normalCharacters

tools.regex-cheatsheet.expressiontools.regex-cheatsheet.description
. or [^\n\r]tools.regex-cheatsheet.anyCharacter
[A-Za-z]tools.regex-cheatsheet.alphabet
[a-z]tools.regex-cheatsheet.lowercaseAlphabet
[A-Z]tools.regex-cheatsheet.uppercaseAlphabet
\d or [0-9]tools.regex-cheatsheet.digit
\D or [^0-9]tools.regex-cheatsheet.nonDigit
_tools.regex-cheatsheet.underscore
\w or [A-Za-z0-9_]tools.regex-cheatsheet.wordCharacter
\W or [^A-Za-z0-9_]tools.regex-cheatsheet.nonWordCharacter
\Stools.regex-cheatsheet.nonWhitespace

tools.regex-cheatsheet.whitespaceCharacters

tools.regex-cheatsheet.expressiontools.regex-cheatsheet.description
tools.regex-cheatsheet.space
\ttools.regex-cheatsheet.tab
\ntools.regex-cheatsheet.newline
\rtools.regex-cheatsheet.carriageReturn
\stools.regex-cheatsheet.whitespace

tools.regex-cheatsheet.characterSet

tools.regex-cheatsheet.characterSetNote

tools.regex-cheatsheet.expressiontools.regex-cheatsheet.description
[xyz]tools.regex-cheatsheet.eitherXYZ
[^xyz]tools.regex-cheatsheet.neitherXYZ
[1-3]tools.regex-cheatsheet.either123
[^1-3]tools.regex-cheatsheet.neither123

tools.regex-cheatsheet.escapingCharacters

tools.regex-cheatsheet.outsideCharacterSet

tools.regex-cheatsheet.expressiontools.regex-cheatsheet.description
\.tools.regex-cheatsheet.period
\^tools.regex-cheatsheet.caret
\$tools.regex-cheatsheet.dollarSign
\|tools.regex-cheatsheet.pipe
\\tools.regex-cheatsheet.backSlash
\/tools.regex-cheatsheet.forwardSlash
\(tools.regex-cheatsheet.openingBracket
\)tools.regex-cheatsheet.closingBracket
\[tools.regex-cheatsheet.openingSquareBracket
\]tools.regex-cheatsheet.closingSquareBracket
\{tools.regex-cheatsheet.openingCurlyBracket
\}tools.regex-cheatsheet.closingCurlyBracket

tools.regex-cheatsheet.insideCharacterSet

tools.regex-cheatsheet.expressiontools.regex-cheatsheet.description
\\tools.regex-cheatsheet.backSlash
\]tools.regex-cheatsheet.closingSquareBracket

tools.regex-cheatsheet.quantifiers

tools.regex-cheatsheet.quantifiersNote

tools.regex-cheatsheet.expressiontools.regex-cheatsheet.description
{2}tools.regex-cheatsheet.exactly2
{2,}tools.regex-cheatsheet.atLeast2
{2,7}tools.regex-cheatsheet.atLeast2NoMoreThan7
*tools.regex-cheatsheet.zeroOrMore
+tools.regex-cheatsheet.oneOrMore
?tools.regex-cheatsheet.exactlyZeroOrOne

tools.regex-cheatsheet.boundaries

tools.regex-cheatsheet.expressiontools.regex-cheatsheet.description
^tools.regex-cheatsheet.startOfString
$tools.regex-cheatsheet.endOfString
\btools.regex-cheatsheet.wordBoundary

tools.regex-cheatsheet.wordBoundaryHow

  • tools.regex-cheatsheet.wordBoundaryRule1
  • tools.regex-cheatsheet.wordBoundaryRule2
  • tools.regex-cheatsheet.wordBoundaryRule3

tools.regex-cheatsheet.matching

tools.regex-cheatsheet.expressiontools.regex-cheatsheet.description
foo|bartools.regex-cheatsheet.matchEitherFooOrBar
foo(?=bar)tools.regex-cheatsheet.matchFooBeforeBar
foo(?!bar)tools.regex-cheatsheet.matchFooNotBeforeBar
(?<=bar)footools.regex-cheatsheet.matchFooAfterBar
(?<!bar)footools.regex-cheatsheet.matchFooNotAfterBar

tools.regex-cheatsheet.groupingAndCapturing

tools.regex-cheatsheet.capturingGroupsNote

tools.regex-cheatsheet.expressiontools.regex-cheatsheet.description
(foo)tools.regex-cheatsheet.capturingGroup
(?:foo)tools.regex-cheatsheet.nonCapturingGroup
(foo)bar\1tools.regex-cheatsheet.backreference

tools.regex-cheatsheet.complexExamples

tools.regex-cheatsheet.emailValidation

^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$

tools.regex-cheatsheet.emailExampleDesc

tools.regex-cheatsheet.matches: user@example.com, test.email+tag@domain.co.uk
tools.regex-cheatsheet.noMatch: invalid.email, @domain.com, user@

tools.regex-cheatsheet.phoneNumber

^(\+?1[-.\s]?)?\(?([0-9]{3})\)?[-.\s]?([0-9]{3})[-.\s]?([0-9]{4})$

tools.regex-cheatsheet.phoneExampleDesc

tools.regex-cheatsheet.matches: (555) 123-4567, +1-555-123-4567, 555.123.4567
tools.regex-cheatsheet.noMatch: 123-456, 555-123-45678

tools.regex-cheatsheet.passwordStrength

^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{8,}$

tools.regex-cheatsheet.passwordExampleDesc

tools.regex-cheatsheet.matches: MyPass123!, SecureP@ss1
tools.regex-cheatsheet.noMatch: password, 12345678, MyPassword

tools.regex-cheatsheet.urlExtraction

https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)

tools.regex-cheatsheet.urlExampleDesc

tools.regex-cheatsheet.matches: https://www.example.com, http://sub.domain.org/path
tools.regex-cheatsheet.noMatch: example.com, ftp://server.com

tools.regex-cheatsheet.dateFormat

^(0[1-9]|1[0-2])\/(0[1-9]|[12][0-9]|3[01])\/\d{4}$

tools.regex-cheatsheet.dateExampleDesc

tools.regex-cheatsheet.matches: 12/25/2023, 01/01/2024, 06/15/2023
tools.regex-cheatsheet.noMatch: 13/25/2023, 1/1/2023, 2023-12-25

tools.regex-cheatsheet.creditCard

^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|3[47][0-9]{13}|3[0-9]{13}|6(?:011|5[0-9]{2})[0-9]{12})$

tools.regex-cheatsheet.creditCardExampleDesc

tools.regex-cheatsheet.matches: 4111111111111111, 5555555555554444
tools.regex-cheatsheet.noMatch: 1234567890123456, 411111111111111

tools.regex-cheatsheet.referencesAndTools

tools.regex-cheatsheet.onlineTools

tools.regex-cheatsheet.documentation