Regular Expressions 101

Save & Share

Flavor

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

Function

  • Match
  • Substitution
  • List
  • Unit Tests
"
doi.+(10\.\d{4,6}\/[^\"'&<% \t\n\r\f\v]+)
"
i
doi
matches the characters doi literally (case insensitive)
.
matches any character (except for line terminators)
+ matches the previous token between one and unlimited times, as many times as possible, giving back as needed (greedy)
1st Capturing Group
(10\.\d{4,6}\/[^\"'&<% \t\n\r\f\v]+)
10
matches the characters 10 literally (case insensitive)
\. matches the character . with index 4610 (2E16 or 568) literally (case insensitive)
\d
matches a digit (equivalent to [0-9])
{4,6} matches the previous token between 4 and 6 times, as many times as possible, giving back as needed (greedy)
\/ matches the character / with index 4710 (2F16 or 578) literally (case insensitive)
Match a single character not present in the list below
[^\"'&<% \t\n\r\f\v]
+ matches the previous token between one and unlimited times, as many times as possible, giving back as needed (greedy)
\" matches the character " with index 3410 (2216 or 428) literally (case insensitive)
'&<%
matches a single character in the list '&<% (case insensitive)
\t matches a tab character (ASCII 9)
\n matches a line-feed (newline) character (ASCII 10)
\r matches a carriage return (ASCII 13)
\f matches a form-feed character (ASCII 12)
\v matches a vertical tab character
Global pattern flags
i modifier: insensitive. Case insensitive match (ignores case of [a-zA-Z])
Your regular expression does not match the subject string.

Regular Expression
No Match

r"
"
i

Test String