Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.71 KB | None | 0 0
  1. <a href="url">url</a>
  2.  
  3. _^(?:(?:https?|ftp)://)(?:S+(?::S*)?@)?(?:(?!10(?:.d{1,3}){3})(?!127(?:.d{1,3}){3})(?!169.254(?:.d{1,3}){2})(?!192.168(?:.d{1,3}){2})(?!172.(?:1[6-9]|2d|3[0-1])(?:.d{1,3}){2})(?:[1-9]d?|1dd|2[01]d|22[0-3])(?:.(?:1?d{1,2}|2[0-4]d|25[0-5])){2}(?:.(?:[1-9]d?|1dd|2[0-4]d|25[0-4]))|(?:(?:[a-zx{00a1}-x{ffff}0-9]+-?)*[a-zx{00a1}-x{ffff}0-9]+)(?:.(?:[a-zx{00a1}-x{ffff}0-9]+-?)*[a-zx{00a1}-x{ffff}0-9]+)*(?:.(?:[a-zx{00a1}-x{ffff}]{2,})))(?::d{2,5})?(?:/[^s]*)?$_iuS
  4.  
  5. /_(?:(?:https?|ftp)://)(?:S+(?::S*)?@)?(?:(?!10(?:.d{1,3}){3})(?!127(?:.d{1,3}){3})(?!169.254(?:.d{1,3}){2})(?!192.168(?:.d{1,3}){2})(?!172.(?:1[6-9]|2d|3[0-1])(?:.d{1,3}){2})(?:[1-9]d?|1dd|2[01]d|22[0-3])(?:.(?:1?d{1,2}|2[0-4]d|25[0-5])){2}(?:.(?:[1-9]d?|1dd|2[0-4]d|25[0-4]))|(?:(?:[a-zx{00a1}-x{ffff}0-9]+-?)*[a-zx{00a1}-x{ffff}0-9]+)(?:.(?:[a-zx{00a1}-x{ffff}0-9]+-?)*[a-zx{00a1}-x{ffff}0-9]+)*(?:.(?:[a-zx{00a1}-x{ffff}]{2,})))(?::d{2,5})?(?:/[^s]*)?_iuS/g
  6.  
  7. preg_replace($regex, '<a href="$0">$0</a>', $examplestring);
  8.  
  9. If this modifier is set, letters in the pattern match both upper and lower
  10. case letters.
  11.  
  12. This modifier inverts the "greediness" of the quantifiers so that they are
  13. not greedy by default, but become greedy if followed by ?. It is not compatible
  14. with Perl. It can also be set by a (?U) modifier setting within the pattern
  15. or by a question mark behind a quantifier (e.g. .*?).
  16.  
  17. When a pattern is going to be used several times, it is worth spending more
  18. time analyzing it in order to speed up the time taken for matching. If this
  19. modifier is set, then this extra analysis is performed. At present, studying
  20. a pattern is useful only for non-anchored patterns that do not have a single
  21. fixed starting character.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement