File tree Expand file tree Collapse file tree 2 files changed +3
-1
lines changed
Expand file tree Collapse file tree 2 files changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -156,7 +156,7 @@ def extract_linkedin_url(text: str) -> str | None:
156156 linkedin_url = f"https://{ cleaned } "
157157
158158 if not re .match (
159- r"^https://([\w-]+\.)?linkedin\.com/in/(?:[\w\-]|%[0-9A-Fa-f]{2})+$" ,
159+ r"^https://([\w-]+\.)?linkedin\.com/in/(?:[\w\-]|%[0-9A-Fa-f]{2})+(?:/[\w\-]+)* $" ,
160160 linkedin_url ,
161161 ):
162162 print (f"Invalid LinkedIn URL: { linkedin_url } " )
Original file line number Diff line number Diff line change @@ -50,6 +50,8 @@ def test_extract_mastodon_url(input_string, result):
5050 "https://regional.linkedin.com/in/example" ,
5151 "https://regional.linkedin.com/in/example" ,
5252 ),
53+ ("in/user123/nl" , "https://linkedin.com/in/user123/nl" ),
54+ ("https://nl.linkedin.com/in/user123/en" , "https://nl.linkedin.com/in/user123/en" ),
5355 ],
5456)
5557def test_extract_linkedin_url (input_string , result ):
You can’t perform that action at this time.
0 commit comments