     return string if not _.isString string
     val = @_splitter string, [/[=.&?]/, /[^=.&?]/]
     _.each query_params, (qparam) ->
-      qparam = new RegExp "#{qparam}", 'i' if not _.isRegExp qparam
+      qparam = new RegExp "(^|[=.&?])#{qparam}", 'i' if not _.isRegExp qparam
       _.each val, (v, i) ->
         val[i + 2] = "[REDACTED]" if val[i + 2]? and val[i + 1] is '=' and qparam.test v
     val.join('')
-
 
   @plain_text: (keywords) ->
     keywords = pt_def if not keywords?[0]? or not _.isArray keywords

class Scrubbers
  bk_def = ['password', 'user', 'email', 'api', 'secret']
  ue_def = ['client_id', 'client_secret', 'refresh_token']
  pt_def = ['user', 'password', 'email']

  @default: ->
    bk = Scrubbers.bad_keys()
    ue = Scrubbers.url_encode()
    pt = Scrubbers.plain_text()
    _.compose(pt, ue, bk)

  @bad_vals: (substrings) ->
    return (object) =>

    return string if not _.isString string
    val = @_splitter string , [/[^=:\s]/, /[\s=:]/]
    _.each keywords, (keyword) ->
      keyword = new RegExp "^#{keyword}$", 'i' if not _.isRegExp keyword
      _.each val, (v, i) ->
        val[i + 2] = '[REDACTED]' if val[i + 1] isnt '=' and val[i + 2]? and keyword.test v
    val.join('')
