Regular Expressions 101

Save & Share

  • Save Regex
    ctrl+s

Flavor

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

Function

  • Match
  • Substitution
  • List
  • Unit Tests
/
asignarValores\((['"])([^'"\\]*(?:(?:\\.|(?!\1)['"])[^'"\\]*)*)\1, (['"])([^'"\\]*(?:(?:\\.|(?!\3)['"])[^'"\\]*)*)\3, (['"])([^'"\\]*(?:(?:\\.|(?!\5)['"])[^'"\\]*)*)\5, (['"])([^'"\\]*(?:(?:\\.|(?!\7)['"])[^'"\\]*)*)\7, (['"])([^'"\\]*(?:(?:\\.|(?!\9)['"])[^'"\\]*)*)\9, (['"])([^'"\\]*(?:(?:\\.|(?!\11)['"])[^'"\\]*)*)\11, (['"])([^'"\\]*(?:(?:\\.|(?!\13)['"])[^'"\\]*)*)\13\)
/
g
asignarValores
matches the characters asignarValores literally (case sensitive)
\( matches the character ( with index 4010 (2816 or 508) literally (case sensitive)
1st Capturing Group
(['"])
Match a single character present in the list below
['"]
'"
matches a single character in the list '" (case sensitive)
2nd Capturing Group
([^'"\\]*(?:(?:\\.|(?!\1)['"])[^'"\\]*)*)
Match a single character not present in the list below
[^'"\\]
* matches the previous token between zero and unlimited times, as many times as possible, giving back as needed (greedy)
'"
matches a single character in the list '" (case sensitive)
\\ matches the character \ with index 9210 (5C16 or 1348) literally (case sensitive)
Non-capturing group
(?:(?:\\.|(?!\1)['"])[^'"\\]*)*
* matches the previous token between zero and unlimited times, as many times as possible, giving back as needed (greedy)
Non-capturing group
(?:\\.|(?!\1)['"])
1st Alternative
\\.
\\ matches the character \ with index 9210 (5C16 or 1348) literally (case sensitive)
. matches any character (except for line terminators)
2nd Alternative
(?!\1)['"]
Negative Lookahead
(?!\1)
Assert that the Regex below does not match
\1 matches the same text as most recently matched by the 1st capturing group
Match a single character present in the list below
['"]
'"
matches a single character in the list '" (case sensitive)
Match a single character not present in the list below
[^'"\\]
* matches the previous token between zero and unlimited times, as many times as possible, giving back as needed (greedy)
'"
matches a single character in the list '" (case sensitive)
\\ matches the character \ with index 9210 (5C16 or 1348) literally (case sensitive)
\1 matches the same text as most recently matched by the 1st capturing group
,
matches the characters , literally (case sensitive)
3rd Capturing Group
(['"])
Match a single character present in the list below
['"]
'"
matches a single character in the list '" (case sensitive)
4th Capturing Group
([^'"\\]*(?:(?:\\.|(?!\3)['"])[^'"\\]*)*)
Match a single character not present in the list below
[^'"\\]
* matches the previous token between zero and unlimited times, as many times as possible, giving back as needed (greedy)
'"
matches a single character in the list '" (case sensitive)
\\ matches the character \ with index 9210 (5C16 or 1348) literally (case sensitive)
Non-capturing group
(?:(?:\\.|(?!\3)['"])[^'"\\]*)*
* matches the previous token between zero and unlimited times, as many times as possible, giving back as needed (greedy)
Non-capturing group
(?:\\.|(?!\3)['"])
1st Alternative
\\.
\\ matches the character \ with index 9210 (5C16 or 1348) literally (case sensitive)
. matches any character (except for line terminators)
2nd Alternative
(?!\3)['"]
Negative Lookahead
(?!\3)
Assert that the Regex below does not match
\3 matches the same text as most recently matched by the 3rd capturing group
Match a single character present in the list below
['"]
'"
matches a single character in the list '" (case sensitive)
Match a single character not present in the list below
[^'"\\]
* matches the previous token between zero and unlimited times, as many times as possible, giving back as needed (greedy)
'"
matches a single character in the list '" (case sensitive)
\\ matches the character \ with index 9210 (5C16 or 1348) literally (case sensitive)
\3 matches the same text as most recently matched by the 3rd capturing group
,
matches the characters , literally (case sensitive)
5th Capturing Group
(['"])
Match a single character present in the list below
['"]
'"
matches a single character in the list '" (case sensitive)
6th Capturing Group
([^'"\\]*(?:(?:\\.|(?!\5)['"])[^'"\\]*)*)
Match a single character not present in the list below
[^'"\\]
* matches the previous token between zero and unlimited times, as many times as possible, giving back as needed (greedy)
'"
matches a single character in the list '" (case sensitive)
\\ matches the character \ with index 9210 (5C16 or 1348) literally (case sensitive)
Non-capturing group
(?:(?:\\.|(?!\5)['"])[^'"\\]*)*
* matches the previous token between zero and unlimited times, as many times as possible, giving back as needed (greedy)
Non-capturing group
(?:\\.|(?!\5)['"])
1st Alternative
\\.
\\ matches the character \ with index 9210 (5C16 or 1348) literally (case sensitive)
. matches any character (except for line terminators)
2nd Alternative
(?!\5)['"]
Negative Lookahead
(?!\5)
Assert that the Regex below does not match
\5 matches the same text as most recently matched by the 5th capturing group
Match a single character present in the list below
['"]
Match a single character not present in the list below
[^'"\\]
* matches the previous token between zero and unlimited times, as many times as possible, giving back as needed (greedy)
'"
matches a single character in the list '" (case sensitive)
\\ matches the character \ with index 9210 (5C16 or 1348) literally (case sensitive)
\5 matches the same text as most recently matched by the 5th capturing group
,
matches the characters , literally (case sensitive)
7th Capturing Group
(['"])
Match a single character present in the list below
['"]
'"
matches a single character in the list '" (case sensitive)
8th Capturing Group
([^'"\\]*(?:(?:\\.|(?!\7)['"])[^'"\\]*)*)
\7 matches the same text as most recently matched by the 7th capturing group
,
matches the characters , literally (case sensitive)
9th Capturing Group
(['"])
10th Capturing Group
([^'"\\]*(?:(?:\\.|(?!\9)['"])[^'"\\]*)*)
\9 matches the same text as most recently matched by the 9th capturing group
,
matches the characters , literally (case sensitive)
11th Capturing Group
(['"])
12th Capturing Group
([^'"\\]*(?:(?:\\.|(?!\11)['"])[^'"\\]*)*)
\11 matches the same text as most recently matched by the 11th capturing group
,
matches the characters , literally (case sensitive)
13th Capturing Group
(['"])
14th Capturing Group
([^'"\\]*(?:(?:\\.|(?!\13)['"])[^'"\\]*)*)
\13 matches the same text as most recently matched by the 13th capturing group
\) matches the character ) with index 4110 (2916 or 518) literally (case sensitive)
Global pattern flags
g modifier: global. All matches (don't return after first match)
Your regular expression does not match the subject string.Try launching the debugger to find out why.

Regular Expression
No Match

/
/
g

Test String