正则表达式的意思,求指点.Matcher m = Pattern.compile("[frb][aiu][gx]").matcher("fix the rug with bags"); while(m.find()) System.out.print(m.group() + " ");

来源:学生作业帮助网 编辑:作业帮 时间:2024/05/05 12:59:05
正则表达式的意思,求指点.Matcher m = Pattern.compile(

正则表达式的意思,求指点.Matcher m = Pattern.compile("[frb][aiu][gx]").matcher("fix the rug with bags"); while(m.find()) System.out.print(m.group() + " ");
正则表达式的意思,求指点.
Matcher m = Pattern.compile("[frb][aiu][gx]").matcher("fix the rug with bags");
while(m.find())
System.out.print(m.group() + " ");

正则表达式的意思,求指点.Matcher m = Pattern.compile("[frb][aiu][gx]").matcher("fix the rug with bags"); while(m.find()) System.out.print(m.group() + " ");
[frb][aiu][gx]
这里匹配一个3个字符的字符串
第一个字符是f,r,b中的任意一个
第二个字符是a,i,u中的任意一个
第三个字符是g,x中的任意一个