我有一个字符串:
hello example >> hai man
如何使用 Java 正则表达式或其他技术提取“hai man”?
最佳答案
您可以使用正则表达式:
String str = "hello example >> hai man";
String result = str.replaceAll(".*>>\\s*(.*)", "$1");
关于java - 如何使用正则表达式或其他技术解析该字符串?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4153704/