Myregextester.com is the premier online regular expressions tester that allows visitors to construct, test, and optimize regular expressions.

 Click here to manually set the number of rows for match/replacement textareas. Regex Cheat Sheet Regex Tutorials Regex Book

URL SOURCE:   FILE SOURCE:

MATCH PATTERN:

REPLACEMENT PATTERN:

OPERATION: # # USE .NET FLAGS: i
x
m
s
 Help SHOW MATCH ARRAY:    EXPLAIN:  OPTIMIZE:    SHOW CODE: PHP
ASP
VB.NET
C#.NET
Java
JS
DELIM: HIGHLIGHT MATCHES:      GEN SAMPLES:   
    Save example     Help     FROM: TO: 

PASSWORD RESTRICTIONS:

Allow only these characters:  (any character)  ]
At Least  Total Characters
No More Than   Total Characters
At Least  Lowercase Characters (a-z)
At Least  Uppercase Characters (A-Z)
At Least  Numeric Characters (0-9)
At Least  Special Characters in [^a-zA-Z0-9]  ]
Disallow sequential alphanumeric sequences of or more (i.e. 123... abc... ABC...)
Disallow repeating characters of or more (i.e. 11... aa... AA... %%...)

WORD LIST:



SOURCE TEXT:

HIGHLIGHTED MATCHES:

Select All (to copy etc.)
CAPTURE GROUPS Help
0
 
1
 
2

<div>
<h1>##TEST1&ID=123&bob=yahoo&email=oioiujij##</h1>
<h1>##TEST2##</h1>
<h1>##TEST3##</h1>
<h1>##TEST4&ID=123&bob=yahoo&email=oioiujij##</h1>
<h1>##TEST5##</h1>
</div>

RESULTS:

Select All (to copy etc.)
Execution Time(sec.):
0.000021

Raw Match Pattern:
(?<=##)([^&\\n]*?)(&.*?)?(?=##)

Classic ASP Code Example:

<%
Set regEx = New RegExp
regEx.Global = True
sourcestring = "your source string"
regEx.Pattern = "(?<=##)([^&\\n]*?)(&.*?)?(?=##)"
Set Matches = regEx.Execute(sourcestring)
  For z = 0 to Matches.Count-1
    results = results & "Matches(" & z & ") = " & chr(34) & Server.HTMLEncode(Matches(z)) & chr(34) & chr(13)
    For zz = 0 to Matches(z).SubMatches.Count-1
      results = results & "Matches(" & z & ").SubMatches(" & zz & ") = " & chr(34) & Server.HTMLEncode(Matches(z).SubMatches(zz)) & chr(34) & chr(13)
    next
    results=Left(results,Len(results)-1) & chr(13)
  next
Response.Write "<pre>" & results
%>


$matches Array:
(
    [0] => Array
        (
            [0] => TEST1&ID=123&bob=yahoo&email=oioiujij
            [1] => </h1>
<h1>
            [2] => TEST2
            [3] => </h1>
<h1>
            [4] => TEST3
            [5] => </h1>
<h1>
            [6] => TEST4&ID=123&bob=yahoo&email=oioiujij
            [7] => </h1>
<h1>
            [8] => TEST5
        )

    [1] => Array
        (
            [0] => TEST1
            [1] => </h1>
<h1>
            [2] => TEST2
            [3] => </h1>
<h1>
            [4] => TEST3
            [5] => </h1>
<h1>
            [6] => TEST4
            [7] => </h1>
<h1>
            [8] => TEST5
        )

    [2] => Array
        (
            [0] => &ID=123&bob=yahoo&email=oioiujij
            [1] => 
            [2] => 
            [3] => 
            [4] => 
            [5] => 
            [6] => &ID=123&bob=yahoo&email=oioiujij
            [7] => 
            [8] => 
        )

)