/** * Constructor. * * @param regex * the regular expression to match against. */ public NameLike(String regex) { this.regex = new Regex(regex); }
/** * @see org.dihedron.core.filters.Filter#matches(java.lang.Object) */ @Override public boolean matches(String object) { return regex.matches(object); } }
/** * Constructor. * * @param regex * a regular expression. */ public Filter(Regex regex) { this.regex = regex; logger.debug("checking regex /{}/, case {}", regex, (regex.isCaseSensitive() ? "sensitive" : "insensitive")); }
BufferedReader output = new BufferedReader(new InputStreamReader(process.getInputStream())); Regex regex = new Regex("^\\s*(.*)\\s+(?:on)\\s+(.*)\\s+(?:type)\\s+(.*)\\s+(?:\\(.*\\))\\s*$"); List<String[]> matches = regex.getAllMatches(line); if(matches != null && !matches.isEmpty()) { for(String [] group : matches) {
Regex regex = new Regex(COLOR_REGEX, false); if(regex.matches(value.trim())) { int r = -1, g = -1, b = -1; String[] matches = regex.getAllMatches(value).get(0); if(matches[0] != null && matches[0].equals("#")) {
Regex regex = new Regex(VARIABLE_PATTERN, caseSensitive); List<String[]> variables = null; while(oneVariableBound && (variables = regex.getAllMatches(replaceText)).size() > 0) { oneVariableBound = false; logger.trace("analysing text: '{}'", replaceText);
Regex regex = new Regex(VARIABLE_PATTERN, caseSensitive); List<String[]> variables = null; while(oneVariableBound && (variables = regex.getAllMatches(replaceText)).size() > 0) { oneVariableBound = false; logger.trace("analysing text: '{}'", replaceText);
/** * @see org.dihedron.core.filters.Filter#matches(java.lang.Object) */ @Override public boolean matches(String object) { return regex.matches(object); } }
/** * Constructor. * * @param regex * the regular expression to match against. * @param caseSensitive * whether the match should be case sensitive (default: {@code true}). */ public Matches(String regex, boolean caseSensitive) { this.regex = new Regex(regex, caseSensitive); }
Regex regex = new Regex(VARIABLE_PATTERN, caseSensitive); List<String[]> variables = null; while(oneVariableBound && !(variables = regex.getAllMatches(replaceText)).isEmpty()) { oneVariableBound = false; logger.trace("analysing text: '{}'", replaceText);
/** * @see org.dihedron.core.filters.Filter#matches(java.lang.Object) */ @Override public boolean matches(String object) { return regex.matches(object); } }
/** * Constructor. * * @param regex * the regular expression to match against. */ public NameLike(String regex) { this.regex = new Regex(regex); }
/** * Checks whether a resource complies with the filter criteria. */ public boolean accept(File dir, String name) { boolean result = regex.matches(name); logger.debug("checked resource '{}', result is {}", name, result); return result; }
/** * Constructor. * * @param regex * the regular expression to match against. */ public NameLike(String regex) { this.regex = new Regex(regex); }
/** * @see org.dihedron.commons.reflection.ReflectorFilter#matches(java.lang.reflect.Member) */ @Override public boolean matches(T member) { return regex.matches(member.getName()); } }
/** * Constructor. * * @param pattern * the pattern to match against file names. * @param files * an output list of files matching the given name pattern. */ public FileFinderVisitor(String pattern, List<File> files) { regex = new Regex(pattern); this.files = files; }
/** * @see org.dihedron.commons.reflection.ReflectorFilter#matches(java.lang.reflect.Member) */ @Override public boolean matches(T member) { return regex.matches(member.getName()); } }
/** * Constructor. * * @param regex * the regular expression to match against. * @param caseSensitive * whether the match should be case sensitive (default: {@code true}). */ public Matches(String regex, boolean caseSensitive) { this.regex = new Regex(regex, caseSensitive); }
/** * @see org.dihedron.commons.reflection.ReflectorFilter#matches(java.lang.reflect.Member) */ @Override public boolean matches(T member) { return regex.matches(member.getName()); } }
/** * Constructor. * * @param regex * the regular expression to match against. * @param caseSensitive * whether the match should be case sensitive (default: {@code true}). */ public Matches(String regex, boolean caseSensitive) { this.regex = new Regex(regex, caseSensitive); }