正则表达式移除前缀

需要将 [淘宝]xxxx旗舰店  变为 xxx旗舰店

将[淘宝] 这样的前缀移除掉.

/**

* 移除前缀

* @param string

* @return

*/

private static  String removePre(String shopName) {

try {

if(shopName==null||shopName.length()<=0){

return "";

}

return shopName.replaceAll("(\\[)(.*?)(\\])", "");

 

} catch (Exception e) {

e.printStackTrace();

}

return "";

}

你可能感兴趣的:(正则表达式移除前缀)