How to validate a LinkedIn public profile url

后端 未结 9 2717
迷失自我
迷失自我 2021-02-20 16:43

I am looking for a way to validate a link to make sure that it is pointing to a LinkedIn public profile page in PHP.

I have a website and I would like my users to be abl

9条回答
  •  一整个雨季
    2021-02-20 16:58

    This is tested regular expression that I use on my website. I fit all the variations that currently exist.

    var linkedin=/(https?)?:?(\/\/)?(([w]{3}||\w\w)\.)?linkedin.com(\w+:{0,1}\w*@)?(\S+)(:([0-9])+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/;
    

提交回复
热议问题