Regular Expressions 101

Community Patterns

Match all links except for links enclosed in curly brackets

0

Regular Expression
PCRE2 (PHP >=7.3)

@
(?<![\S\{])(http|ftp)?(s)?(://)?(([a-zA-Z])([-\w]+\.)+([^\s\.]+[^\s]*)+[^,.\s])([^\}\s]+)(?![\S\}])
@

Description

Match all links except for links enclosed in curly brackets

Submitted by anonymous - a year ago