我想把前面的"[www.163.com "替换掉,可是程序执行时却有错误,如何解决?
import java.util.regex.*;
public class ghost { public static void main(String[] args) {
// TODO Auto-generated method stub
String str1 = "[www.163.com net]this is netease [www.163.com net]" ;
str1= str1.replaceFirst("\\[.+\\s", "hello") ;
System.out.println(str1) ;
}}
import java.util.regex.*;
public class ghost { public static void main(String[] args) {
// TODO Auto-generated method stub
String str1 = "[www.163.com net]this is netease [www.163.com net]" ;
str1= str1.replaceFirst("\\[.+\\s", "hello") ;
System.out.println(str1) ;
}}
解决了