Test, validate and match regular expressions
Matches plain-text URLs starting with http://, https://, ftp://, file://, www., ftp., youtube., or youtu.be, consuming URL-safe characters and requiring the link to end in an alphanumeric/safe character (avoiding trailing punctuation). A negative lookahead and lookbehind skip URLs already inside HTML anchor tags or quoted attributes like href="...". Ideal for extracting clickable links—especially YouTube URLs—from HTML text without duplicating existing hyperlinks.