title: jsonObject as string - searching for regular expression to remove password field
body: <p>I have a json String which will have somewhere in its content a string like this: </p>
  
  <pre><code> "password": "password2"
  </code></pre>
  
  <p>This can be anywhere in the json string, so don't assume it's on the first level. it can even be in a jsonArray. So I need to search the entire string and remove this field, or put its value as null. </p>
  
  <p>So I need to be able to search the entire string and replace the password.  For example the string could look like this:</p>
  
  <p>I just want it for logging. My issue is, I want to remove the password value as I am sharing it with a 3rd party.</p>
  
  <p>I need in java to use a regular expression that will search this string and replace the password value with an empty string, or I can do md5 of password even.  It must not fail if there is no password string existing.  How can I do this?   So to be clear, given any input as a string I want the result after filter to be:</p>
  
  <pre><code> "password": ""
  </code></pre>
  
  <p>Or it can be a md5 of password value instead of null if its easier. Can you help?</p>
  
  <p>So the function I want to create will look like this:</p>
  
  <pre><code>public String removePasswordFromJsonString(String jsonString){
  
  
    //.. do the regualar expression work here....
  
    return jsonString;
  
  }
  </code></pre>