fixed regex in detect