java正则: 忽略大小写匹配

复制代码
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import com.sun.org.apache.xerces.internal.impl.xpath.regex.CaseInsensitiveMap;

public class test {

    public static void main(String[] args) {
        String str = "java JavA ABC";
        Pattern test_ = Pattern.compile("java",Pattern.CASE_INSENSITIVE);
        Matcher result_ = test_.matcher(str);

        str = result_.replaceAll("Perl6");
        
        System.out.println(str);
        
    }


}
复制代码

 

posted on   Perl6  阅读(11627)  评论(0编辑  收藏  举报

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5
点击右上角即可分享
微信分享提示