I have following xml tags:
<EmployerName>company name</EmployerName>
and <Email>name@gmail.com</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?
The working DEMO
If you want to match everything within the tags, just use
.
: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:Your expression is missing the space “company name”. Try replacing the following:
… with
$1$2
. Backreferencing didn’t work in Notepad++, so it’s a little verbose.