I'm returning some data from a database that looks like this
<[<language><text xml:lang="">Automation1406741539346</text></language>]>
What would be the easiest and best way I can remove everything from this string except Automation1406741539346?
I'm returning some data from a database that looks like this
<[<language><text xml:lang="">Automation1406741539346</text></language>]>
What would be the easiest and best way I can remove everything from this string except Automation1406741539346?
Try this regex..
public static void main(String[] args) {
String s= "<[<language><text xml:lang=\"\">Automation1406741539346</text></language>]>";
Pattern p = Pattern.compile("<text.*?>(.*?)</text>");
Matcher m = p.matcher(s);
m.find();
System.out.println(m.group(1));
}
O/P :
Automation1406741539346