I assume that a and b are the only valid characters.
Your original expression matches any string containing ab . A complement is any string that does not contain ab . In other words, if a exists, the next character must be another a or the end of the string. If a b occurs, it must be up to all a s.
So this gives the result:
b*a*
I think your expression is equivalent to this.
source share