我正在尝试标准化linkedin网址。为此,我使用正则表达式
唯一有效的模式是:
^https:\/\/[w]{3}\.linkedin\.com\/.*$
,这需要根据新的要求进行更改。唯一有效的模式是:
https://www.linkedin.com/in/XXXXXX-XXXXX-55301b41
https://www.linkedin.com/pub/XXXXXX-XXXXX-55301b41
https://www.linkedin.com/public-profile/in/XXXXXX-XXXX-b82a7b10a
https://www.linkedin.com/public-profile/pub/XXXXXX-XXXX-b82a7b10a
https://www.linkedin.com/in/xxxx-xxxx-ab85a328/%7Bcountry%3Dde%2C+language%3Dde%7D?trk=people-guest_profile-result-card_result-card_full-click
https://www.linkedin.com/edu/school?id=18987
https://www.linkedin.com/in/xxxx-xxxx-55301b41/de
https://www.linkedin.com/pub/xxxxx-xxxxx/98/b7a/22b
https://it.linkedin.com/public-profile/in/xxxx-xxxxx-80520667?challengeId=AQEV3tHveORYsAAAAXQqx1N3bZ7fd44s5ngegJp6rC0UoWvhG2LtAhhgld8h3QyBxorfcLL2iuvK4xh_UKoGguxvX6sFx_nnZA&submissionId=7bc972ed-bfd1-2e16-c395-ad35cb550117
- 必须以https://www.linkedin.com/开头
- 必须有/in/,/pub/,/public-profile/in/或/public-profile/pub
- 应以用户名结尾,即XXXXXX-XXXXX-55301b41