Anyone have a good QtRegEx expression for parsing a string into a complex number?
I'm looking for formats including:

A+Bi
A
Bi
i

where A and B are floating point numbers including embedded signs and exponents, i is either "i" or "j". + is either "+" or "-". And spaces can be sprinkled between the patterns.

I've tried "^\\s*(\\S*)\\s*([+-]{0,1})\\s*(\\S*)\\s*([iIjJ])\\s$" but that fails, I think because all the patterns are optional.

I can also match several special cases in sequence but that seems inelegant.

Thanks,
Max