git match replaced with indexOf for special characters