parsing strings for complex numbers and writing complex numbers to strings