How do I replace all the characters with nothing (thus deleting them) up to a certain character? I have a log string which is an XML request:
I have a string like this:
Mon Dec 19 09:50:50 EST 2016:INFO:
string = "test-testing ID:idm-zx-sawe.3CE65834D32AD741:370 <?xml version="1.0" encoding="UTF-8"?>"
string.replaceAll("([^,]*'<')", "").replaceAll("(?m)^\\s*ID.*","");
I need to remove all the charters before <?xml
and return the following string: "test-testing ID:idm-zx-sawe.3CE65834D32AD741:370
I'm trying with this regular expression:
/.*<\?/ - need this translated to groovy string.replaceAll(".*<\?","")