DEV Community

Discussion on: How do you regex?

lepinekong profile image
lepinekong • Edited on

My approach is to use iterative method to do regex decomposition and I write down the mental process to achieve this or I will just learn and forget, just learn and forget "Ad vitam Eternam" like I used to in the past :D example below - I'm using figjam document to create code notes (free with to do this (with the help of a plugin I'm building to generate the whole expression from the parts) - especially important to be able to understand a regex you wrote x weeks or months before so I also not matching and non matching samples for above each regex part. I also embed playground in figjam doc. In the future by improving the plugin I will be able to have direct real time playground while playing with the parts.

That's how I'm now much more confident to write my own regex without googling which is by the way an increase in productivity ;)

Alt text