Fixed regex compilation error in remove prefix and suffix. (still need to make other regex functions safe)