If your situation requires the use of a regular expression, use the search() method, otherwise; the indexOf() method is more performant.
If your situation requires the use of a regular expression, use the search() method, otherwise; the indexOf() method is more performant.