slightly improved discover regex pattern