如何判断一个字符串开头是以AIRH,D或E开头的,零基础正则表达式,求大神帮助啊
##反正 \w*表示任意字符 。你判断时加上他就好了
http://blog.csdn.net/ljheee/article/details/50859182
你看看这个,很容易的
String str = "EDddf";
String regEx = "[[AIRH]|D|E][a-zA-Z_]{1,}";
Pattern pattern = Pattern.compile(regEx);
// 忽略大小写的写法
// Pattern pat = Pattern.compile(regEx, Pattern.CASE_INSENSITIVE);
Matcher matcher = pattern.matcher(str);
// 字符串是否与正则表达式相匹配
boolean rs = matcher.matches();
System.out.println(rs);
最近也在学正则表达式:blogdn.net/ljheee/article/details/50859182.cs
/^((AIRH)|D|E)+/