rails where + regex code example Example: rails where regex @max_draw = Drawing.where("drawing_number ~* ?", '^A\d{4}$')