JavaScript Journey Episode 5 - RegEx (Regular Expression) Testing User Input in The Form & Validate
This JavaScript Journey Episode 5 is all about Regex or Regular Expression in JavaScript, in Which to check a specific input of the user from the form, and then check it in the Regex Object that I made if it matches then validate.
Name: Bryan Ganzon Granse - A.K.A bryanDevs
Language: JavaScript
Episode: 5
Goal: Front-End Developer to Backend Developer to Full-Stack Developer
CSS Framework: Tailwind / Bootstrap
I mainly focus first on my strong understanding of the fundamental of Vanilla JavaScript, then proceed to TypeScript, and JavaScript Frameworks like Vue.js, Angular.js, React.js, and Next.js. My learning is infinite so I would like to document it here on my YouTube Channel.
Also, I think I do love to learn first the TypeScript/NodeJs and then ReactJs, since it seems to me that this is a bit fun, that's why I get my fixed plan to proceed ReactJs after mastering the in-depth Vanilla JS.
Now About This Video, TODO called 'RegEx or Regular Expression'
I will code it and take note that this is my TODO Exercise, that is why you see that CSS and HTML are already been added because this is just a JavaScript Journey, now the step will be added below about these small Exercises.
1. Declare the variable to get all the inputs in the form using the Query Selector All.
2. Next is, to create an Object for Regular Expression, which handles the username, password, email, telephone, and slugs, so all of it is based on that form created via HTML.
3. Now after that I use the FOR OF LOOP since I selected all the inputs which will return an HTML Collection that is why we need to loop it, you can also use the FOR EACH loop depending on your preference, but here I use FOR OF Loop.
4. I created a normal Function that will test the Regular Expression base on that RegEx Pattern I created in the object and call it inside the FOR OFF Loop which I added an Event Listener Keyup.
5. After that, you can see I tested it then since the user did not meet the requirement in the form there is an error message that will appear which set up to be opacity in the CSS class.
Want me to explain the Regular Expression Here? will I would love to do it, just leave a comment below.
JavaScript Journey Episode 5 - RegEx (Regular Expression) Testing User Input in The Form & Validate
javascript,javascript journey,javascript coding,javascript documentation,my coding journey,full stack journey,front-end developer portfolio,back-end web development,js,javascript vanilla,javascript for beginners,javascript tutorial,javascript tutorial for beginners,bryanDevs,Bryan Devs,Bryan Granse TV