I'd like to mask out sensitive credit card details. Therefore trying to create matcher that finds:
- that there is a CreditCard tag
- that the same line has a Number field
- that the same line has a CVC field
<CreditCard Number="123456789" CVC="111" />
Then I want to replace the numbers/values that are found.
So far I have: (CreditCard.*CVC=").*?"
. This would match the string CreditCard Number="123456789" CVC="111"
.
What do I have to change so that only the numbers inside either CVC or Number double quotes are matched?