i have done such requirements many times and from many years
solution is,
you have to apply multiple expressions to handle special cases
along with one or two major expressions to do all general cases.
and then apply them in recursion.
like this if you have got 6 regular expressions then write some code like this.
loop this six times
{
out_string = apply_regex(in_string, regex pattern[loop count]);
in_string = out_string;
}
this will considerably reduce the complexity and give a very simple solution to maintain.
in addition write some code to test such, sequential expressions. this makes like further easy.