           cssText = if opts.minify then cssmin(opts.css) else opts.css
           hash = crypto.createHash("md5").update(text + cssText).digest("hex")
           id = "#{module.name}-#{hash}#{if opts.minify then ".min" else ""}"
-          rId = new RegExp('(define\\([\'"])' + module.name)
-          text = text.replace rId, '$1' + id
+          rId = re('(define\\([\'"])' + module.name)
+          text = text.replace rId, "$1" + id
 
           name = join argv.staticpath, "#{id}.js"
           write name, text

            (n) -> join argv.staticpath, n
          ].reverse())(moduleName)

        # returns the order for a css dep like 'css!100:foo.css'
        cssOrder = (moduleName) ->
          +(moduleName.match(/^css!((\d+):)?/)[2] or "0")


    .argv

  specified = (argName, shorthand) ->
    argv[argName+"Specified"] = _.any process.argv, (arg) ->
      RegExp("^-{1,2}" + argName).test(arg) or (arg is "-" + shorthand)

  specified("templatepath", "t")
  specified("staticpath", "s")
