title: Regular expression using sed
body: <p>In the past I have asked this question.But somehow I did not give the complete input.Input is a log file. I am trying to use sed to replace all but last four digits of credi card number.</p>
  
  <pre><code>sed -e :a -e "s/[0-9]\([0-9]\{4\}\)/\*\1/;ta" $today_temp_log
  </code></pre>
  
  <p>This expression definitely works but it replaces not just Credit card numbers but some otehr data too(where digits are more than 4). Input record which contains Credit Card number is of the format :</p>
  
  <pre><code>"CARD_NUMBER=[6362229292929290]"
  </code></pre>
  
  <p>So I need to replace record of above format.So the above record should be converted to</p>
  
  <pre><code>"CARD_NUMBER=[************9290]"
  </code></pre>
  
  <p>Thanks in advance.</p>