Regex Phone Number - Step by Step

preview_player
Показать описание
This is the basics of a phone number regex to just help you understand how to write regex in general

VIDEO CORRECTION!! The end of the regex needs to be a $ not a ?

^\+?\d.\s? // +1 or +44
\(?\d{3}\)? // first part
[-.\s]? // possible spacing / sep
\d{3} // 2nd part
[-.\s]? // possible spacing / sep
\d{4}? // 3rd part
Рекомендации по теме
Комментарии
Автор

Normally, technical "how-to" videos suck. They're convoluted and impossible to understand for the non-coder. In such cases, I normally feel compelled to throw out a nerd insult such as, "This guy is obviously sitting in a dark room somewhere, nude from the waist down, and binge-watching Star Trek." That said, your video is a refreshing difference to all those hard-to-understand videos. Excellent job, Bro.

ctjsca
Автор

Best regex seen till now. Thanks a lot!!

mohammedshahidrahman
Автор

Great video man . Kudos. The best explanation that could exist for this .❤️

sachinupadhyay
Автор

i've spent literally two days trying to solve this isue. You had the exact solution for my problem.

winstondemoura
Автор

You are a rare breed who can explain regex. well done. d. should be d{0, 3} I think?

wilsonparry
Автор

best, i learn regex in like a second with your explanation!

cookiigames
Автор

Thank you very much for the lesson.

If you want you can put a window into video which to say that the end of the regex should have "$" not "?".

GOD bless you.

georgigeorgiev
Автор

This is awesome. I've been searching all over the place to figure out what \ means ha. Not that complicated!

jacks
Автор

You are awesome, best explanation so far.

zakariaaulin
Автор

Thank you so much for sharing this information. It was easy to understand and very helpful.

ruthpenn
Автор

Great tutorial. Wish you would have gone into the imbalanced parenthesis handling.

kerryruddock
Автор

Very helpful 👍 but it is not printing first "(" ! what can be the solution?

prekshathakkar
Автор

Ver nice, , learned some more about it,
But didn't you forget the question mark after d(0, 3) for optional?

DopeVlogs
Автор

how would you change this to match a specific number that might be written in various formats ei: match the numbers exactly 123 456 7890, even when written in the different formats? PLZ HELP I REALLY NEED THIS! :)

Svetacus
Автор

Why didn't you use question mark infront Of hipen

Gamerroxky
Автор

Thanks for the video, it helped me a lot.

luizamescolotto
Автор

does * modifier works? its zero or more

lycan
Автор

Great tutorial, broke it down perfectly.

limited
Автор

helped me a lot😊 this is same in php as well?

pikupikulist
Автор

Upload video of email validation by regular expression?

srinivaslaxmiu
visit shbcf.ru