anantoghosh/react-linkify-it

Maybe can we create a wiki of common regex patterns

Closed this issue · 1 comments

That might be cool to help others pick. Maybe with examples that pattern matches. Like two table column. I can see not wanting to do this, and closing this issue. Just a thought as I was struggling with the phone.

I'm using this pattern for phone I found here https://stackoverflow.com/q/4338267/1828637 , but not sure if it's right as it misses +1 (999) 999-9999.

const phoneRegex = /\+?\(?\d{3}\)?[\s.-]?\d{3}[\s.-]?\d{4,6}/;

I could include a prebuilt component for Phone numbers. I know phone numbers are written in a variety of ways so at least for now I've left it up to the user to use what they find the best.
The discussions section is open in this repo for any support.