I need to do a replacement on the escaped XML chars >
<
and &
, but only when they are contained within single quotes. This is important because the regex pattern shouldn't be able to find the >
and<
when they are the beginning and ending tags.
Example, given the string <Element><Element value="'hello&stack<overflow>'"/></Element>
I should only get the >
<
and &
that are within the single quotes '
.
This is so I can replace them with the proper &
<
and >
(Long story it's the result of a muddled XML parsing that happened).
I know I can use '(.*)'
to get all characters in between the single quotes, but now how can I extract only the escaped characters within that.