3 ms·
Reading regex is much easier than writing them when using visualization tools such as https://regexper.com/ https://regexper.com/, https://regex101.com/ https:/
by lowefk 4y ago
Reading regex is much easier than writing them when using visualization tools such as https://regexper.com/ https://regexper.com/, https://regex101.com/ https://regex101.com/, and https://jex.im/regulex/ https://jex.im/regulex/, especially for beginners. I always use them to read regex.
- pygy_ 4y agoFor JS/TS, I’ll add https://github.com/compose-regexp/compose-regexp.js https://github.com/compose-regexp/compose-regexp.js to that list.
- qrio2 4y agohttps://www.debuggex.com/ https://www.debuggex.com/ is my favorite
- Arbortheus 4y agoUsing regexper changed my life. I’m not afraid of even the most complex regexes anymore.
- JTyQZSnP3cQGa8B 4y agoOr you can use "verbose regex" which some languages implement like in Python (https://docs.python.org/3/library/re.html#re.X https://docs.python.org/3/library/re.html#re.X). The spaces are ignored and you can add comments on each line. I used this in the past and my coworkers were happy about it because they could understand the regex and even modify it.
- krisoft 4y ago> Or you can use "verbose regex" How did I not know about this! Thank you very much. This solves my biggest gripe with regex. > my coworkers were happy about it because they could understand the regex and even modify it. The most important point. Computers might read code efficiently, but if people can't reason about it, that is a recipe for bugs to sneak in.