Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
my $regex = qr/
\A
(
[a-z][a-z0-9+\-.]*:
(
\/\/
([a-z0-9\-._~%!$&'()*+,;=]+@)?
([a-z0-9\-._~%]+
|\[[a-f0-9:.]+\]
|\[v[a-f0-9][a-z0-9\-._~%!$&'()*+,;=:]+\])
(:[0-9]+)?
(\/[a-z0-9\-._~%!$&'()*+,;=:@]+)*\/?
|
(\/?[a-z0-9\-._~%!$&'()*+,;=:@]+(\/[a-z0-9\-._~%!\$&'()*+,;=:@]+)*\/?)?
)
|
(
[a-z0-9\-._~%!$&'()*+,;=@]+(\/[a-z0-9\-._~%!\$&'()*+,;=:@]+)*\/?
|
(\/[a-z0-9\-._~%!$&'()*+,;=:@]+)+\/?
)
)
(\?[a-z0-9\-._~%!$&'()*+,;=:@\/?]*)?
(\#[a-z0-9\-._~%!$&'()*+,;=:@\/?]*)?
\Z
/x;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment