I have following xml tags:
<EmployerName>company name</EmployerName> and <Email>[email protected]</Email>
I am using the following regular expression-
<EmployerName>[0-9A-Z:-]*</EmployerName> to remove the data between tags. But, the data is not getting removed. Any idea?
If you want to match everything within the tags, just use .:
<EmployerName>.*</EmployerName>
Your character group [0-9A-Z:-] covers digits, letters, the colon and the hyphen characters, but it doesn't include whitespace or other special characters.
Then you can replace with simply <EmployerName></EmployerName>.
In case there are multiple EmployerName elements on the same line, use a reluctant match:
<EmployerName>.*?</EmployerName>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With