I have a text while which shows certain output in the form of strings and numbers and from that I have a specific piece of text as follows .I want to extract a certain piece of text from that
This is a small piece of my content
gjhsgdjhgfjhdgfjkhsdgfjkhgsdfk7868736876534
Pattern is:
(4,24,[5,96]) -> (1,14,[14,15]), that is: "Poland" -> "Poland"
(4,46,[36,39]) -> (1,14,[14,15]), that is: "Kim" -> "Kim"
fhafsdhjdfgjhdagfkhj66876493985694(hjiikfghkjfhg,98698)
(hhgjhgdfj,jhgkjdhgf)
From this I want to get the output as
"Poland" -> "Poland"
"Kim" -> "Kim"
"The police" -> "The city police on Friday"
The code I tried is
Pattern p = Pattern.compile("(Pattern is:)\\((.*?)\\)");
Matcher m = p.matcher(str);
while(m.find())
{
System.out.println("fhkjsdfhkjsdh");
System.out.println(m.group(2));
}
on Fridaygo?