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

owing REGEX and it works for my purposes, but I want to exclude strings that look like this "http://twitter.com/share/" or "http://twitter.com/share" (no trailing slash). 

How would I alter this REGEX to NOT match those strings? https://twitter.com/NJerzyFireAlert/status/451162284887265280/photo/1

https?://(?:www\.)?twitter.com/(?:#!/|(?!share)|(?<!share)|intent/user\?screen_name=)?(\w+)

https://twitter.com/MattMakens247Wx/status/451166007751479296/photo/1

https://twitter.com/search?src=typd&q=earthquake%20chile

RESULTS:

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

Raw Match Pattern:
https?://(?:www\.)?twitter.com/(?!share)(?:#!/|intent/user\?screen_name=)?(\w+)

$matches Array:
(
    [0] => Array
        (
            [0] => https://twitter.com/NJerzyFireAlert
            [1] => https://twitter.com/MattMakens247Wx
            [2] => https://twitter.com/search
        )

    [1] => Array
        (
            [0] => NJerzyFireAlert
            [1] => MattMakens247Wx
            [2] => search
        )

)