Skip to content

Commit

Permalink
Fix LinkedIn regex and improve regex handling for all platforms (#1078)
Browse files Browse the repository at this point in the history
  • Loading branch information
zacharykeeping authored Oct 10, 2024
1 parent f0b9879 commit f0af700
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/MobileUI/Features/SocialMedia/AddSocialMediaViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,27 +53,27 @@ private void Initialise(int socialMediaPlatformId)
{
case Constants.SocialMediaPlatformIds.LinkedIn:
PlatformName = "LinkedIn";
Url = "https://www.linkedin.com/in/";
Placeholder = "https://www.linkedin.com/in/[your-name]";
ValidationPattern = "^https://linkedin.com/in/([a-zA-Z0-9._-]+)$";
Url = "https://linkedin.com/in/";
Placeholder = "https://linkedin.com/in/[your-name]";
ValidationPattern = "^https?://(www.)?linkedin.com/in/([a-zA-Z0-9._-]+)$";
break;
case Constants.SocialMediaPlatformIds.GitHub:
PlatformName = "GitHub";
Url = "https://github.com/";
Placeholder = "https://github.com/[your-username]";
ValidationPattern = "^https://github.com/([a-zA-Z0-9._-]+)$";
ValidationPattern = "^https?://(www.)?github.com/([a-zA-Z0-9._-]+)$";
break;
case Constants.SocialMediaPlatformIds.Twitter:
PlatformName = "Twitter";
Url = "https://x.com/";
Placeholder = "https://x.com/[your-username]";
ValidationPattern = "^https://(twitter|x).com/([a-zA-Z0-9._-]+)$";
ValidationPattern = "^https?://(www.)?(twitter|x).com/([a-zA-Z0-9._-]+)$";
break;
case Constants.SocialMediaPlatformIds.Company:
PlatformName = "Company";
Url = "https://";
Placeholder = "https://[your-website]";
ValidationPattern = @"^https://\S+";
ValidationPattern = @"^https?://\S+";
break;
}
}
Expand Down

0 comments on commit f0af700

Please sign in to comment.