Skip to content

Instantly share code, notes, and snippets.

Single-line version of pattern:
(?i)\b((?:http(?:s)?:(?:/{1,3}|[a-z0-9%])|[a-z0-9.\-]+[.][a-z]{2,4})(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\)){0,}(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))
Extended version of same pattern:
(?i) #Ignore Case
\b
( # Capture 1: entire matched URL
(?:
http(?:s)?: # http: and https: only