DEV Community

Discussion on: Getting Started with Regular Expressions

Collapse
 
samuelroland profile image
Samuel Roland

Hey
Thanks for the article! Great introduction!

I wanted to write it on it because I struggled to understand it at the start, but didn't how to start because it's pretty broad subject (to understand I had to learn several not intuitive concepts and make a lot of tests). Now I have some good basics. I didn't know the "+?" combination trick that's great.

The app that helped me a lot (and that you can maybe add to the resource list) is regexr.com (it's opensource!). You can even save your patterns (like this one, publish and browse existing patterns, read a cheat sheet, and the colours and interface really help to understand. I really like the "explanations on hover with selections".
Another websites that looks fun learn-regex.com and regex-one.com.

A few suggestions to enhance it:

  • Explain the goal of regex (like search, validate or replace strings).
  • To say or give example on how to run regex (depends on the languages is important to mention too).
  • Add some examples for simple password validation.
  • Mention that often there is no need to write complex Regex for common use cases (such as email or validation) because they already exist (just need to search and choose one, especially for email where there is no perfect regex AFAIK). Sometimes they are constants or functions that already exist in languages to validate them.
Collapse
 
nickytonline profile image
Nick Taylor

Thanks for the feedback Samuel!
BB-8 giving a thumbs up