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
I've found a number of ways the profile url can look like:
http://uk.linkedin.com/pub/some-name/1/1b3/b45/
http://nl.linkedin.com/pub/other-name/11/223/544
http://www.linkedin.com/in/aname/
http://www.linkedin.com/in/another-name
http://linkedin.com/in/name
http://nl.linkedin.com/in/name
http://nl.linkedin.com/in/name/
I've used this regex to describe it:
^https?://((www|\w\w)\.)?linkedin.com/((in/[^/]+/?)|(pub/[^/]+/((\w|\d)+/?){3}))$
It is not strict-strict but it got me home.
edit
- Added https support