Java tutorial
//package com.java2s; import android.text.TextUtils; import java.util.regex.Matcher; import java.util.regex.Pattern; public class Main { public static boolean patternCode(String patternCoder, String patternContent) { if (TextUtils.isEmpty(patternContent)) { return false; } Pattern p = Pattern.compile(patternCoder); Matcher matcher = p.matcher(patternContent); if (matcher.find()) { return true; } return false; } }