String str = "Text0TEXT1.more text ";
String str = "Text0TEXT1(more text ";
String str = "Text0TEXT1{more text ";
如果我有一條線,它可能是幾個字符,如。或者(或{或;我怎麼能提取TEXT1只java的正則表達式提取,直到特殊字符
更新:有文本0文本1日之前和特殊字符可能會或可能不存在
更新2
String str = "Beginning text Text I want . Text I don't want"
String str = "Beginning text with numbers Text I want (Text I don't want)"
String str = "Beginning text with numbers Text I want { Text I don't want }"
?
我需要提取「文本我想要」,但我得到了文字到最後的休息特殊字符({:。
您可以使用包含這些字符的編譯模式進行分割。 – 2012-03-22 16:53:12
關於你的編輯,你想找回'Text0TEXT1'還是隻有'TEXT1'? – Shaded 2012-03-22 17:01:38
@shaded只有文本1 – tnaser 2012-03-22 17:02:35