in reply to regex help required

You have inadequately said what you are looking for in your answer. The following will match all the above possible combinations in $result, but I strongly suspect that it is not what you want
my $result = $string;
If you spot any bugs in my solutions, it's because I've deliberately left them in as an exercise for the reader! :-)