n******8 发帖数: 172 | 1 String a="> < neededtext here> othertext"
how to obtain the string between first "<" and last ">" |
c**t 发帖数: 2744 | 2 "<(?targe[^>]*)>" );
【在 n******8 的大作中提到】 : String a="> < neededtext here> othertext" : how to obtain the string between first "<" and last ">"
|
n******8 发帖数: 172 | 3 Thanks, any good tutorials online for regex?
【在 c**t 的大作中提到】 : "<(?targe[^>]*)>" );
|
c**t 发帖数: 2744 | 4 http://www.regular-expressions.info/
【在 n******8 的大作中提到】 : Thanks, any good tutorials online for regex?
|
n******8 发帖数: 172 | 5 Exception in thread "main" java.util.regex.PatternSyntaxException: Unknown
inline modifier near index 3
<(?targe[^>]*)>
^
Get busy, will figure it out later. For now, get it done by String.
【在 c**t 的大作中提到】 : http://www.regular-expressions.info/
|
g**********y 发帖数: 14569 | 6 input.replaceAll("^.*?<(.*)>.*?$", "$1"); |