I'm using regular expressions to find certain patterns in natural language processing.
I find myself using the same patterns over and over. and since these patterns can be hard to read in a terse regular expression, I'm asking myself if I should develop a higher order regular language that captures that?
will I be digging myself into a hole trying to define a DSL like that? what's a good framework for developing such a language, and what can I expect in terms of effort of building it? what are some common pitfalls for defining and building such a language?
it could look something like this [views] overlooking [the] ($object)
that would capture text such as "overlooking the ocean" or "overlooking cityscapes".
or another example could be ($granite) counter[- ]tops that would capture text such as "granite countertops" or "quartz counter-tops" (but not "granite counter" or just "countertops"