站内搜索: 请输入搜索关键词

当前页面: 开发资料首页J2SE 专题正则表达式

正则表达式

摘要: 正则表达式


请问允许多个任意字符 是那个转义符

比如 :
模式 Exception
匹配 SQLEception123
这个模式 应该怎么写 我没有找到想应转义符




"Exception"就是这个啊
你有不限制开头结尾,只要被匹配的字符里有Exception存在就算


hellwindy(夜神·月) 你说能好像不对!
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Zzbds
{

public static void main(String[] args)
{
Pattern p = Pattern.compile("Exception");
Matcher m = p.matcher("asdfsafException");
boolean b = m.matches();
if(b)
{
System.out.println("11111");
}
else
{
System.out.println("22222222");
}
}

}


他返回是2222


.*Exception.*


问题已经解决




↑返回目录
前一篇: BT做种的问题
后一篇: 怎样能快速的得到排名