More robust regex