//导包
import java.util.regex.Matcher;
import java.util.regex.Pattern;
if (TextUtils.isEmpty(mMerchantId)){
mMerchantId = subUrlValue(shopUrl);
}
/**
* 正则过滤获取URL里面的shop id
* shopUrl
* @param shopUrl
* @return
/
private String subUrlValue(String shopUrl) {
Pattern p = Pattern.compile("shop-(.?)\.html");
Matcher m = p.matcher(shopUrl);
if (m.find()){
return m.group(1);
}
return "";
}
网友评论