Back to project page tatoeba-offline-android.
The source code is released under:
GNU General Public License
If you think the Android project tatoeba-offline-android listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package org.tatoeba.searchsentences; /* w w w .j a v a2 s. c om*/ import java.util.regex.Matcher; import java.util.regex.Pattern; public class RegexFilter implements Filter { /** * Constructs the regex filter according to the given regex * @param expression The regex to select sentence upon */ RegexFilter( String expression ) { pattern = Pattern.compile( expression ); } /** * @param sentence The sentence to check */ @Override public boolean select(Sentence sentence) { Matcher matcher = pattern.matcher( sentence.data() ); return matcher.matches(); } Pattern pattern; }