org.omnaest.utils.pattern
Class PatternUtils

java.lang.Object
  extended by org.omnaest.utils.pattern.PatternUtils

public class PatternUtils
extends Object

Static helper class related to Pattern concerns

Author:
Omnaest

Constructor Summary
PatternUtils()
           
 
Method Summary
static String not(Collection<String> patternStringCollection)
          Returns a negated pattern that matches everything that does not equal any of the given strings within the Collection
static String not(String... patternStrings)
          Returns a negated pattern that matches everything that does not equal any of the given strings
static String not(String patternString)
          Returns the negated pattern.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PatternUtils

public PatternUtils()
Method Detail

not

public static String not(String... patternStrings)
Returns a negated pattern that matches everything that does not equal any of the given strings

Parameters:
patternStrings -
Returns:
See Also:
not(Collection), not(String)

not

public static String not(Collection<String> patternStringCollection)
Returns a negated pattern that matches everything that does not equal any of the given strings within the Collection

Parameters:
patternStringCollection -
Returns:
See Also:
not(String...), not(String)

not

public static String not(String patternString)
Returns the negated pattern.

E.g. the negation of ABC will result in the non capturing group:
(?:[^A]|(?:)$|A[^B]|(?:A)$|AB[^C]|(?:AB)$)

This ensures the negotiation will not affect capturing of groups and that the negotiation will work on the end of the given input string, too.

Parameters:
patternString -
Returns:


Copyright © 2013. All Rights Reserved.