Skip to content

Instantly share code, notes, and snippets.

@raymcdermott
Created April 7, 2011 21:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save raymcdermott/908742 to your computer and use it in GitHub Desktop.
Save raymcdermott/908742 to your computer and use it in GitHub Desktop.
simple recursion
def scrubOut(line: String, keys: Seq[String]): String = {
// Optimizations... most likely to the left
if (!line.contains("=") || !line.contains("\"") || keys.isEmpty || containsKeys(false, line, keys) == false)
line
else
scrubOut(line.replaceAll(keys.head + "=\".*?\"", keys.head + "=\"****\""), keys.tail)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment