clean up regex/backreference conditional