Java examples for java.util.regex:Match Word
is Ext Jar file by regex
//package com.java2s; import java.util.regex.Matcher; import java.util.regex.Pattern; public class Main { public static void main(String[] argv) throws Exception { String dexFilePath = "java2s.com"; System.out.println(isExtJar(dexFilePath)); }//from w w w . j a v a 2 s . co m private static final Pattern extJarPattern = Pattern .compile("(?:^|\\\\|/)ext.(?:jar|odex)$"); public static boolean isExtJar(String dexFilePath) { Matcher m = extJarPattern.matcher(dexFilePath); return m.find(); } }