Please enable JavaScript to use regex101
/
^
r
e
g
e
x
[
\
-
_
]
?
1
0
1
$
/
i
Reg
ular
Ex
pressions
101
Upgrade to Pro
Enterprise
Regular Expression
r"
http:\/\/(www\.[a-z0-9]+([\-\.][a-z0-9]+)*\.[a-z]{2,5})(:[0-9]{1,5})?(\/.*)?$|^(\/.*)
"
gm
Input 1
1
New
http://www.google.com /~germain/CS4480 http://www.cs.utah.edu/~germain/CS4480 HTTP/1.1 http://www.cs.utah.edu/~germain/CS4480:8080 HTTP/1.1 http://www.cs.utah.edu:8080/~germain/CS4480 http://www.cs.utah.edu/~germain/CS4480
Substitution
http://www.google.com /~germain/CS4480 http://www.cs.utah.edu/~germain/CS4480 HTTP/1.1 http://www.cs.utah.edu/~germain/CS4480:8080 HTTP/1.1 http://www.cs.utah.edu:8080/~germain/CS4480 http://www.cs.utah.edu/~germain/CS4480