I have a problem with parsing text, i have transcript of interview and i have a tag which channel is talking (ch1,ch2). And i need to break it into array and i could to search in which channel someone tells specific word.
For example this is a part of interview
<ch1>Hello</ch1> <ch2>Hello</ch2> <ch1>How are you</ch1><ch2>I'm fine</ch2>
This is a string
String text = "<ch1>Hello</ch1> <ch2>Hello</ch2> <ch2>How are you</ch2>
<ch2>I'm fine</ch2>";
And i want output
String output[] = {<ch1>Hello</ch1>,<ch2>Hello</ch2>,....}
Thanks for help.