Skip to content

PRO TIP Block youtube.com at the DNS level — Pi-hole, NextDNS or your hosts file — but allow youtube-nocookie.com and i.ytimg.com. These tutorials keep playing; the rabbit hole does not.

Learning without distractions

Regex Javascript | Regular Expressions in JavaScript

10.3K views on YouTube

Web Dev Roadmap for Beginners (Free!): https://bit.ly/DaveGrayWebDevRoadmap

Regex (aka Regular Expressions) in JavaScript are very useful. In this tutorial, we’ll take user input for validation and provide hints for the user along the way. We’ll also look at a common fix with regex that most user input will benefit from. Finally, we’ll look at encoding text with encodeURI() and why we should use regex to clean the text first.

Subscribe ➜ https://bit.ly/3nGHmNn

✅ Quick Concepts outline:
Regex in JavaScript:
• Testing for a regex pattern match
• Providing feedback for the user
• Cleaning the input text for storage with replaceAll
• A common problem with user text inputs
• Cleaning the text before encoding

🔗 Code Repository: https://github.com/gitdagray/regex_js_examples

📚 References:
MDN Regular Expressions: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions
RegExer: https://regexr.com/
Regex101: https://regex101.com/

📺 More Beginner JS Videos:
freeCodeCamp: https://youtu.be/PkZNo7MFNFg
Traversy Media: https://youtu.be/hdI2bqOjy3c
The Net Ninja: https://youtu.be/iWOYAxlnaww

✅ Follow Me:
Twitter: https://twitter.com/yesdavidgray
Reddit: https://www.reddit.com/user/DaveOnEleven
Medium: https://medium.com/@davegray_86804

Was this tutorial about Regex (Regular Expressions) in JavaScript helpful? If so, please share. Let me know your thoughts in the comments.

#regex #javascript #js