1. 程式人生 > >java正則: 忽略大小寫匹配

java正則: 忽略大小寫匹配

pac 忽略 void class bsp case println spa .org

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); } }

java正則: 忽略大小寫匹配