Closed vinayak-vohra closed 4 months ago
This PR achieves the following:
Added regular expressions (regex) to validate the following social links:
Regex also validates usernames for GitHub and Instagram. (see below)
Validation checks are not performed in development environment (npm run dev) to avoid testing hinderance.
npm run dev
Regex is optional. Input value is only tested if corresponding regex is available.
UI changes:
https://github.com/user-attachments/assets/eb11c15e-d6b2-4609-8a43-07cd2cf846eb
https://github.com/user-attachments/assets/cf32c979-6dcf-4cfa-9603-c21480966e18
Username Criteria:
Regex used:
Email:
/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
Mobile/Whatsapp:
/((\+*)((0[ -]*)*|((91 )*))((\d{12})+|(\d{10})+))|\d{5}([- ]*)\d{6}/
Github:
/^http(s)?:\/\/(www.)?github.com\/([a-z0-9](-?[a-z0-9]){0,38})$/i
Instagram:
/^https?:\/\/(www\.)?instagram\.com\/(?:(?=.*[a-zA-Z]))([A-Za-z0-9_](?:(?:[A-Za-z0-9_]|(?:\.(?!\.))){0,28}(?:[A-Za-z0-9_]))?)$/
@vinayak-vohra is attempting to deploy a commit to the punyakrit's projects Team on Vercel.
A member of the Team first needs to authorize it.
Related Issue
223
Description
This PR achieves the following:
Added regular expressions (regex) to validate the following social links:
Regex also validates usernames for GitHub and Instagram. (see below)
Validation checks are not performed in development environment (
npm run dev
) to avoid testing hinderance.Regex is optional. Input value is only tested if corresponding regex is available.
UI changes:
Screenshots
https://github.com/user-attachments/assets/eb11c15e-d6b2-4609-8a43-07cd2cf846eb
https://github.com/user-attachments/assets/cf32c979-6dcf-4cfa-9603-c21480966e18
Additional Information
Username Criteria:
Regex used:
Email:
Mobile/Whatsapp:
Github:
Instagram: