How to analyze this string using regex or another technique?

advertisements

I have a string:

hello example >> hai man

How can I extract the "hai man" using Java regex or another technique?


You can use regex as:

String str    = "hello example >> hai man";
String result = str.replaceAll(".*>>\\s*(.*)", "$1");