I have a remove
function that takes a regular expression as a string and another string. It removes everything that matches the regular expression from the second line and returns it.
At the moment, I call the remove
function with literal regular expressions, for example:
remove "(my|a)?string" "Test string" -- returns "Test "
This program will grow, and there will be many regular expressions to call, and each of them can be used several times throughout the program. Should I store them as follows:
myregex = "(my|a)?string"
or should I do a data type or something else?
thanks
source share