Re:Pattern Matching Without Regex – Introducing the Rosie Pa...
by taeric on Wednesday November 14, 2018 @01:45PM
(#18452564)
It isn't that hard to build functions around a lot of this, either. Emacs has the wonderful macro "rx". https://www.emacswiki.org/emacs/rx
I can do this very easily on the command line or in a .<shell>rc file:
I am bad at regex, so I'm sure the example is a poor definition, but the idea is there. I can make variables that hold components of a regex, and since a regex is just a string I can compose these via concatenation.If I did this a lot, I could build a small helper script (or probably just a set of shell functions) to maintain a library file of regex components that I can use in the shell with grep.