Skip to content

Instantly share code, notes, and snippets.

@davidmz
Created June 1, 2015 19:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davidmz/f5adb52d186caf272062 to your computer and use it in GitHub Desktop.
Save davidmz/f5adb52d186caf272062 to your computer and use it in GitHub Desktop.
PCRE для поиска URL в строке
\b
(?:
(?:(https?|ftp)://|www\.)(?:[a-zа-я0-9-]+\.)*[a-zа-я0-9]+
|
(?:[a-zа-я0-9][a-zа-я0-9-]*\.)+(?:ru|com|net|org|рф)(?![\w-])
)
[^<>\s]*
(?:
(?<![[:punct:]])
|
(?<=[-/_&+*])
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment