   constructor: ->
     super
       engineUrl: "https://www.uptodate.com/services/app/contents/search/autocomplete/json?term=%s&limit=10"
-      regexps: "^https?://www\\.uptodate\\.com/"
+      regexps: ["^https?://www\\.uptodate\\.com/"]
       example:
         searchUrl: "https://www.uptodate.com/contents/search?search=%s&searchType=PLAIN_TEXT&source=USER_INPUT&searchControl=TOP_PULLDOWN&autoComplete=false"
         keyword: "upto"

class BaseEngine
  constructor: (options) ->
    extend this, options
    # TODO(philc): Remove this implicit array weirdness. Just make child classes define this an array.
    @regexps = [ @regexps ] if "string" == typeof @regexps
    @regexps = @regexps.map (regexp) -> new RegExp regexp

  match: (searchUrl) -> Utils.matchesAnyRegexp @regexps, searchUrl

  constructor: () ->
    super
      engineUrl: "https://suggestqueries.google.com/complete/search?ss_protocol=legace&client=toolbar&q=%s"
      regexps: ["^https?://[a-z]+\\.google\\.(com|ie|co\\.(uk|jp)|ca|com\\.au)/"]
      example:
        searchUrl: "https://www.google.com/search?q=%s"
        keyword: "g"
