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: # # FLAGS: i
x
m
s
 Help SHOW MATCH ARRAY:    EXPLAIN:    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

Show these:

www.google.com
www.slashdot.com
http://yahoo.com


Tests:

www.showme.com "www.hideme.com" www.showme.com

"www.hideme.com" www.showme.com "www.hideme.com"

RESULTS:

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

Raw Match Pattern:
(?!(?:(?!&quot;)[^"])*("|&quot;)(?:(?:(?!\1).)*\1(?:(?!\1).)*\1)*(?:(?!\1).)*$)(?i)\b((?:[a-z][\w-]+:(?:/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))

PHP Code Example:
 
<?php
$sourcestring="your source string";
preg_match_all('~(?!(?:(?!&quot;)[^"])*("|&quot;)(?:(?:(?!\1).)*\1(?:(?!\1).)*\1)*(?:(?!\1).)*$)(?i)\b((?:[a-z][\w-]+:(?:/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:\'".,<>?«»“”‘’]))~sx',$sourcestring,$matches);
echo "<pre>".print_r($matches,true);
?>
 

$matches Array:
(
    [0] => Array
        (
            [0] => www.google.com
            [1] => www.slashdot.com
            [2] => http://yahoo.com
            [3] => www.showme.com
            [4] => www.showme.com
            [5] => www.showme.com
        )

    [1] => Array
        (
            [0] => 
            [1] => 
            [2] => 
            [3] => 
            [4] => 
            [5] => 
        )

    [2] => Array
        (
            [0] => www.google.com
            [1] => www.slashdot.com
            [2] => http://yahoo.com
            [3] => www.showme.com
            [4] => www.showme.com
            [5] => www.showme.com
        )

    [3] => Array
        (
            [0] => 
            [1] => 
            [2] => 
            [3] => 
            [4] => 
            [5] => 
        )

    [4] => Array
        (
            [0] => 
            [1] => 
            [2] => 
            [3] => 
            [4] => 
            [5] => 
        )

    [5] => Array
        (
            [0] => 
            [1] => 
            [2] => 
            [3] => 
            [4] => 
            [5] => 
        )

    [6] => Array
        (
            [0] => 
            [1] => 
            [2] => 
            [3] => 
            [4] => 
            [5] => 
        )

)