I am trying to extract text in between an xml tag. The text in between the tag is multilingual. For example:
<string xmlns="http://schemas.microsoft.com/2003/10/Serialization/">
तुम्हारा नाम क्या है
</string>
I have tried to google it and got a few regexes but that didn't work Here is one I have tried:
String str = "<string xmlns="+
"http://schemas.microsoft.com/2003/10/Serialization/"+">"+
"तुम्हारा नाम क्या है"+"</string>";
final Pattern pattern = Pattern.compile("<String xmlns="+
"http://schemas.microsoft.com/2003/10/Serialization/"+">(.+?)</string>");
final Matcher matcher = pattern.matcher(str);
matcher.find();
System.out.println(matcher.group(1));
The given String
format is
<string xmlns="http://schemas.microsoft.com/2003/10/Serialization/">
तुम्हारा नाम क्या है
</string>
and the expected output is:
तुम्हारा नाम क्या है
It's giving me an error