I recently encountered a suggestion for the regex patterns utilised across our application code base to be pooled together into a lookup table, and retrieved from there rather than explicitly hard-coded within the program logic.
Can anyone share any thoughts as to the wisdom of this?
My initial thoughts were that it makes the patterns easier to change, which carries both advantages and disadvantages. But, fundamentally, I see a regex string itself as an entity of logic which is (effectively) executed, so storing them in a lookup table just makes me feel a little uneasy.
Thoughts anyone?
Thanks