I have a String that looks like this
<34>Any Character ]
<23>Any Character ]
I want to extract the string based on the starting and the end line. I am trying to create two strings with
String str1 should have <34>Any Character ]
and String str2 should have <23>Any Character ]
Here is my regex = “^<[0-9]>[0-9]+.\n” Its only giving me <34>Any Character ]
I also need to get the second line too
Try –
Java escaped version –
should give you two groups as required.