   constructor: ->
     super
       engineUrl: "https://api.bing.com/osjson.aspx?query=%s"
-      regexps: "^https?://www\\.bing\\.com/search"
+      regexps: ["^https?://www\\.bing\\.com/search"]
       example:
         searchUrl: "https://www.bing.com/search?q=%s"
         keyword: "b"

  constructor: ->
    super
      engineUrl: "https://en.wikipedia.org/w/api.php?action=opensearch&format=json&search=%s"
      regexps: "^https?://[a-z]+\\.wikipedia\\.org/"
      example:
        searchUrl: "https://www.wikipedia.org/w/index.php?title=Special:Search&search=%s"
        keyword: "w"

class BaseEngine
  constructor: (options) ->
    extend this, options
    @regexps = @regexps.map (regexp) -> new RegExp regexp

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