title: Regex mask replacement pattern for Phonenumber
body: <p>I am new to regex 
  I have phone number regex pattern  as (?\d{3})?-? *\d{3}-? *-?\d{4}</p>
  
  <p>I am trying to mask phone number to display only last 4 digits.</p>
  
  <p>I am using a function Regex.Replace("(123) 556-7890 ", "(?\d{3})?-? *\d{3}-? *-?\d{4}", "#")</p>
  
  <p>Would some one help me what would be the replace pattern.</p>
  
  <p>I need out put like for . Input can be XML or JSON</p>
  
  <p><strong>Input</strong><br>
  PhoneNumber> (123) 556-7890  PhoneNumber> </p>
  
  <p><strong>Output</strong>
  PhoneNumber>(XXX) XXX-7890 PhoneNumber></p>
  
  <p><strong>Input</strong><br>
  PhoneNumber> 123 556 7890 PhoneNumber> </p>
  
  <p><strong>Output</strong>
  PhoneNumber>XXX XXX 7890 PhoneNumber></p>
  
  <p><strong>Input</strong><br>
  PhoneNumber> (123) 556- 7890 PhoneNumber> </p>
  
  <p><strong>Output</strong>
  PhoneNumber>(XXX) XXX- 7890 PhoneNumber></p>