Regular Expressions 101

@regex101
Donate
Sponsor
Contact
Bug Reports & Feedback
Wiki
Whats new?

Save & Share

Flavor

  • PCRE2 (PHP >=7.3)
  • PCRE (PHP <7.3)
  • ECMAScript (JavaScript)
  • Python 2.7
  • Golang
  • Java 8

Function

  • Match
  • Substitution
  • List
  • Unit Tests
/
^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$
/
^ asserts position at start of the string
1st Capturing Group
([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)
1st Alternative
[^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]
Match a single character not present in the list below
[^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]
+ matches the previous token between one and unlimited times, as many times as possible, giving back as needed (greedy)
\x00-\x20 matches a single character in the range between (index 0) and (index 32) (case sensitive)
\x22 matches the character " with index 2216 (3410 or 428) literally (case sensitive)
\x28 matches the character ( with index 2816 (4010 or 508) literally (case sensitive)
\x29 matches the character ) with index 2916 (4110 or 518) literally (case sensitive)
\x2c matches the character , with index 2C16 (4410 or 548) literally (case sensitive)
\x2e matches the character . with index 2E16 (4610 or 568) literally (case sensitive)
\x3a-\x3c matches a single character in the range between : (index 58) and < (index 60) (case sensitive)
\x3e matches the character > with index 3E16 (6210 or 768) literally (case sensitive)
\x40 matches the character @ with index 4016 (6410 or 1008) literally (case sensitive)
\x5b-\x5d matches a single character in the range between [ (index 91) and ] (index 93) (case sensitive)
\x7f-\xff matches a single character in the range between  (index 127) and ÿ (index 255) (case sensitive)
2nd Alternative
\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22
\x22 matches the character " with index 2216 (3410 or 428) literally (case sensitive)
2nd Capturing Group
([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*
* matches the previous token between zero and unlimited times, as many times as possible, giving back as needed (greedy)
A repeated capturing group will only capture the last iteration. Put a capturing group around the repeated group to capture all iterations or use a non-capturing group instead if you're not interested in the data
1st Alternative
[^\x0d\x22\x5c\x80-\xff]
Match a single character not present in the list below
[^\x0d\x22\x5c\x80-\xff]
\x0d matches the character with index D16 (1310 or 158) literally (case sensitive)
\x22 matches the character " with index 2216 (3410 or 428) literally (case sensitive)
\x5c matches the character \ with index 5C16 (9210 or 1348) literally (case sensitive)
\x80-\xff matches a single character in the range between € (index 128) and ÿ (index 255) (case sensitive)
2nd Alternative
\x5c[\x00-\x7f]
\x5c matches the character \ with index 5C16 (9210 or 1348) literally (case sensitive)
Match a single character present in the list below
[\x00-\x7f]
\x22 matches the character " with index 2216 (3410 or 428) literally (case sensitive)
3rd Capturing Group
(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*
* matches the previous token between zero and unlimited times, as many times as possible, giving back as needed (greedy)
A repeated capturing group will only capture the last iteration. Put a capturing group around the repeated group to capture all iterations or use a non-capturing group instead if you're not interested in the data
\x2e matches the character . with index 2E16 (4610 or 568) literally (case sensitive)
4th Capturing Group
([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)
1st Alternative
[^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]
Match a single character not present in the list below
[^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]
+ matches the previous token between one and unlimited times, as many times as possible, giving back as needed (greedy)
\x00-\x20 matches a single character in the range between (index 0) and (index 32) (case sensitive)
\x22 matches the character " with index 2216 (3410 or 428) literally (case sensitive)
\x28 matches the character ( with index 2816 (4010 or 508) literally (case sensitive)
\x29 matches the character ) with index 2916 (4110 or 518) literally (case sensitive)
\x2c matches the character , with index 2C16 (4410 or 548) literally (case sensitive)
\x2e matches the character . with index 2E16 (4610 or 568) literally (case sensitive)
\x3a-\x3c matches a single character in the range between : (index 58) and < (index 60) (case sensitive)
\x3e matches the character > with index 3E16 (6210 or 768) literally (case sensitive)
\x40 matches the character @ with index 4016 (6410 or 1008) literally (case sensitive)
\x5b-\x5d matches a single character in the range between [ (index 91) and ] (index 93) (case sensitive)
\x7f-\xff matches a single character in the range between  (index 127) and ÿ (index 255) (case sensitive)
2nd Alternative
\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22
\x22 matches the character " with index 2216 (3410 or 428) literally (case sensitive)
5th Capturing Group
([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*
\x22 matches the character " with index 2216 (3410 or 428) literally (case sensitive)
\x40 matches the character @ with index 4016 (6410 or 1008) literally (case sensitive)
6th Capturing Group
([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)
1st Alternative
[^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]
Match a single character not present in the list below
[^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]
+ matches the previous token between one and unlimited times, as many times as possible, giving back as needed (greedy)
\x00-\x20 matches a single character in the range between (index 0) and (index 32) (case sensitive)
\x22 matches the character " with index 2216 (3410 or 428) literally (case sensitive)
\x28 matches the character ( with index 2816 (4010 or 508) literally (case sensitive)
\x29 matches the character ) with index 2916 (4110 or 518) literally (case sensitive)
\x2c matches the character , with index 2C16 (4410 or 548) literally (case sensitive)
\x2e matches the character . with index 2E16 (4610 or 568) literally (case sensitive)
\x3a-\x3c matches a single character in the range between : (index 58) and < (index 60) (case sensitive)
\x3e matches the character > with index 3E16 (6210 or 768) literally (case sensitive)
\x40 matches the character @ with index 4016 (6410 or 1008) literally (case sensitive)
\x5b-\x5d matches a single character in the range between [ (index 91) and ] (index 93) (case sensitive)
\x7f-\xff matches a single character in the range between  (index 127) and ÿ (index 255) (case sensitive)
2nd Alternative
\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d
\x5b matches the character [ with index 5B16 (9110 or 1338) literally (case sensitive)
7th Capturing Group
([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*
* matches the previous token between zero and unlimited times, as many times as possible, giving back as needed (greedy)
A repeated capturing group will only capture the last iteration. Put a capturing group around the repeated group to capture all iterations or use a non-capturing group instead if you're not interested in the data
1st Alternative
[^\x0d\x5b-\x5d\x80-\xff]
2nd Alternative
\x5c[\x00-\x7f]
\x5d matches the character ] with index 5D16 (9310 or 1358) literally (case sensitive)
8th Capturing Group
(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*
* matches the previous token between zero and unlimited times, as many times as possible, giving back as needed (greedy)
A repeated capturing group will only capture the last iteration. Put a capturing group around the repeated group to capture all iterations or use a non-capturing group instead if you're not interested in the data
\x2e matches the character . with index 2E16 (4610 or 568) literally (case sensitive)
9th Capturing Group
([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)
$ asserts position at the end of the string
Your regular expression does not match the subject string.

Regular Expression
No Match

/
/

Test String