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

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM