regex any urls or links in php

前端 未结 2 1535
臣服心动
臣服心动 2021-01-17 07:54

I have that regex to catch any url in php :

((([A-Za-z]{3,9}:(?:\\/\\/)?)(?:[-;:&=\\+\\$,\\w]+@)?[A-Za-z0-9.-]+|(?:www.|[-;:&=\\+\\$,\\w]+@)[A-Za-z0-         


        
2条回答
  •  误落风尘
    2021-01-17 08:19

    May try this one:

    \b(?:(?:https?|ftp|file)://|www\.|ftp\.)[-A-Z0-9+&@#/%=~_|$?!:,.]*[A-Z0-9+&@#/%=~_|$]
    

    Explanation

    
    

提交回复
热议问题