Pattern (start and end slashes will be added when needed)
Replacement
Subject
Matches
Code
Result
Help PHP PCRE
- .
- Any character
- ^
- Start of subject (or line in multiline mode)
- $
- End of subject (or line in multiline mode)
- [
- Start character class definition
- ]
- End character class definition
- |
- Alternates (OR)
- (
- Start subpattern
- )
- End subpattern
- \
- Escape character
- \n
- Newline (hex 0A)
- \r
- Carriage return (hex 0D)
- \t
- Tab (hex 09)
- \d
- Decimal digit
- \D
- Charchater that is not a decimal digit
- \h
- Horizontal whitespace character
- \H
- Character that is not a horizontal whitespace character
- \s
- Whitespace character
- \S
- Character that is not a whitespace character
- \v
- Vertical whitespace character
- \V
- Character that is not a vertical whitespace character
- \w
- "Word" character
- \W
- "Non-word" character
- \b
- Word boundary
- \B
- Not a word boundary
- \A
- Start of subject (independent of multiline mode)
- \Z
- End of subject or newline at end (independent of multiline mode)
- \z
- End of subject (independent of multiline mode)
- \G
- First matching position in subject
- n*
- Zero or more of n
- n+
- One or more of n
- n?
- Zero or one occurrences of n
- {n}
- n occurrences
- {n,}
- At least n occurrences
- {,m}
- At the most m occurrences
- {n,m}
- Between n and m occurrences
Help PHP POSIX
- .
- Any character
- ^
- Start of subject (or line in multiline mode)
- $
- End of subject (or line in multiline mode)
- [
- Start character class definition
- ]
- End character class definition
- |
- Alternates (OR)
- (
- Start subpattern
- )
- End subpattern
- \
- Escape character
- [:alnum:]
- Alphanumeric character
- [:alpha:]
- Alpha character
- [:digit:]
- Digit
- [:blank:]
- Space and tab
- [:upper:]
- Uppercase alpha character
- [:lower:]
- Lowercase alpha character
- [:space:]
- Space character
- [:punct:]
- Puctuation character
- n*
- Zero or more of n
- n+
- One or more of n
- n?
- Zero or one occurrences of n
- {n}
- n occurrences
- {n,}
- At least n occurrences
- {,m}
- At the most m occurrences
- {n,m}
- Between n and m occurrences
Help Javascript
- .
- Any character
- ^
- Start of subject
- $
- End of subject
- [
- Start character class definition
- ]
- End character class definition
- |
- Alternates (OR)
- (
- Start subpattern
- )
- End subpattern
- \b
- Word boundary
- \B
- Non-worn boundary
- \n
- Newline
- \f
- Form feed character
- \r
- Carriage return character
- \t
- Horizontal tab character
- \v
- Vertical tab character
- \w
- Word character
- \W
- Non-word character
- \d
- Digit
- \D
- Non-digit
- \s
- Space character, equialent to [ \t\r\n\v\f]
- \S
- Non-space character, equialent to [^ \t\r\n\v\f]
- \
- Escape character
- n*
- Zero or more of n
- n+
- One or more of n
- n?
- Zero or one occurrences of n
- {n}
- n occurrences
- {n,}
- At least n occurrences
- {,m}
- At the most m occurrences
- {n,m}
- Between n and m occurrences
Help Perl
- .
- Any character
- ^
- Start of subject
- $
- End of subject
- [
- Start character class definition
- ]
- End character class definition
- |
- Alternates (OR)
- (
- Start subpattern
- )
- End subpattern
- \b
- Word boundary
- \B
- Non-worn boundary
- \n
- Newline
- \f
- Generic newline
- \f
- Form feed character
- \r
- Carriage return character
- \t
- Horizontal tab character
- \v
- Vertical tab character
- \w
- Word character
- \W
- Non-word character
- \d
- Digit
- \D
- Non-digit
- \s
- Space character, equialent to [ \t\r\n\v\f]
- \S
- Non-space character, equialent to [^ \t\r\n\v\f]
- \
- Escape character
- n*
- Zero or more of n
- n+
- One or more of n
- n?
- Zero or one occurrences of n
- {n}
- n occurrences
- {n,}
- At least n occurrences
- {,m}
- At the most m occurrences
- {n,m}
- Between n and m occurrences
Help Python
- .
- Any character
- ^
- Start of subject
- $
- End of subject
- [
- Start character class definition
- ]
- End character class definition
- |
- Alternates (OR)
- (
- Start subpattern
- )
- End subpattern
- \b
- Word boundary
- \B
- Non-worn boundary
- \n
- Newline
- \f
- Generic newline
- \f
- Form feed character
- \r
- Carriage return character
- \t
- Horizontal tab character
- \v
- Vertical tab character
- \w
- Word character
- \W
- Non-word character
- \d
- Digit
- \D
- Non-digit
- \s
- Space character, equialent to [ \t\r\n\v\f]
- \S
- Non-space character, equialent to [^ \t\r\n\v\f]
- \
- Escape character
- n*
- Zero or more of n
- n+
- One or more of n
- n?
- Zero or one occurrences of n
- {n}
- n occurrences
- {n,}
- At least n occurrences
- {,m}
- At the most m occurrences
- {n,m}
- Between n and m occurrences