DEV Community

Discussion on: How do you regex?

Collapse
 
pinotattari profile image
Riccardo Bernardini • Edited
  • Tools? None, most of the times. For most complex regex, I wrote myself a nice "regexp generator" library that allows me to "build" regexp in more readable way.
  • Problems? It depends on the language, actually. In Ruby I use them mostly to parse simple line-based text files. In Ada I use them more sparingly, usually when I need some kind of lexical analyzer. The reason for this difference is that in Ruby using regexp is much easier: just write something like /[a-z][0-9]+/, in Ada it is a bit more involved.