zoukankan      html  css  js  c++  java
  • 正则表达式练习20200108之匹配不区分大小写字母的字符串

    package org.jimmy.autosearch.test;
    
    import java.util.regex.Pattern;
    
    public class RegexTest2020010701 {
    
        private static Pattern musicReg = Pattern.compile("(?i)[.]mp3");
        
        public static void main(String[] args) {
            String test = ".mp3";
            boolean result = musicReg.matcher(test).matches();
            System.out.println(result);
            test = ".Mp3";
            result = musicReg.matcher(test).matches();
            System.out.println(result);
            test = ".MP3";
            result = musicReg.matcher(test).matches();
            System.out.println(result);
            test = "a.MP3";
            result = musicReg.matcher(test).matches();
            System.out.println(result);
        }
    
    }

    效果图:

     好了.

  • 相关阅读:
    画板
    多线程
    Runtime
    今日头条UI搭建
    支付宝UI界面搭建
    控制器的创建
    UIWindow简单介绍
    UIApplication
    UIPickerView的使用
    代理、通知、KVO
  • 原文地址:https://www.cnblogs.com/JimmySeraph/p/12165421.html
Copyright © 2011-2022 走看看