Help understanding RegExp

Help understanding RegExp
0

#1

I keep on over-complicating my code with extra if statements and arrays because of my inability to understand how one uses RegExp.

I’ve read the MDN and W3 school pages on them and I have some rough idea on what they’re good for but, when it comes time to use one I get stuck hard.

Any one have any other resources that dumb it down a bit? Maybe even some simple practice lessons.

Thanks.


#2

You can check this-
https://regexone.com/


#3

http://regex101.com is my go to resource. It explains the regex you type to you in plain English, and has a built in test runner.


#4

#5

That video is stellar!


#6

I didn’t know about the html5 input patterns! That makes my form validation about a thousand times faster!


#7

yep some fantastic resources here in this thread … really going to help me with understanding regular expressions better.


#8

I try to do an algorithm on Code Wars every day, and about half the time the best solution involves a regular expression. Some problems are tagged ‘Regular Expressoins’ but I have just been working my way the ‘Fundamentals’ tag and it comes up all the time. The way the site it set up, once you solve the problem, you can see every submitted solution. I’ve learned a lot by struggling with a Regex myself, then taking someone else’s code and forking it, or at least googling it. Regex is crazy sometimes but it’s become one of my favorite parts of coding, along with writing .reduce() into every function, LOL. Keep at it and good luck!


#9

Thanks all. Still haven’t had a moment to go through it all but, a lot of great suggestions here.


#10

Just what I was looking for. Awesome!


#11

That video was a great help.Thanks for sharing