make regex more robust