晕,我无语了,楼主的jdk版本肯定是低于1。4
你看我的java 1.4的doc
replaceAll
public String replaceAll(String regex,
String replacement)Replaces each substring of this string that matches the given regular expression with the given replacement.
An invocation of this method of the form str.replaceAll(regex, repl) yields exactly the same result as the expression
Parameters:
regex - the regular expression to which this string is to be matched
Returns:
The resulting String
Throws:
PatternSyntaxException - if the regular expression's syntax is invalid
NullPointerException - if regex is null
Since:
1.4
See Also:
Pattern