I need some help with regex which does not work perfect:
/(?<=([H|h][i|I])+\w+\>)(.*)(?=(\<))/
I have got a few XML, I need to filter out the errorMessage
and the errorCode
from those XMLs. Not all XML have the same syntax. Sometimes errorMessage
sometimes ERRORTEXT
sometimes Error_Messages
is the tag name in my XMLs.
An example:
<?xml version="1.0" endcoding=UTF-8"?>
<n0:szemelyKutyaFuleResponsexmlns:prx="urn:sap.comproxy:SWP:/1SAI/TREASE1243804269AE457508F4:753" mmlns:n0="http://csajgeneratorws.tny.interfesz.kok.lo/">
<return>
<tanzakciosAzonosito>46981682-4637-49d2-bd4d-dcfff543742ed</tanzakciosAzonosito>
<erdmeny>HIBAS</eredmeny>
<errorCode>TSH08</errorCode>
<errorMessage>Azonosítószám már hozzá lett rendelve üzleti partnerhez</errorMessage>
</return>
</n0:szemelyKutyaFuleResponse>
I think I need to create two regex:
- One to find the text
TSH08
inerrorCode
- and another regex to find
Azonosítószám már hozzá lett rendelve üzleti partnerhez
inerrorMessage
!
Pls help THX