title: Regular Expression replace expression for credit card in logback.xml
body: <p>I want to perform masking on any number of length 12 to 16 in logs.</p>
  <p>Masking should be like:</p>
  <ol>
  <li>For 12 digits (657854377864) - XXXXXXXX7864</li>
  <li>For 16 digits (7843657854377864)   - 7843XXXXXXXX7864</li>
  <li>For 13, 14 and 15 digits -- similar to 12 digits</li>
  </ol>
  <p>if I use below configuration:</p>
  <pre><code>&lt;pattern&gt;
    %d{dd-MM-yyyy HH:mm:ss.SSS} %magenta([%thread]) %highlight(%-5level) - %replace(%msg{'\d{12,16}','XXXX'}%n
        &lt;/pattern&gt;
    &lt;/encoder&gt;
  </code></pre>
  <p>it converts all digits into XXXX - is there any way to print first 4 and last 4 digits as it is in the logs using regex in log file itselt</p>