Class Wildcard

java.lang.Object
de.kosmos_lab.utils.Wildcard

public class Wildcard
extends Object
this class is used to parse
  • Constructor Details

    • Wildcard

      public Wildcard()
  • Method Details

    • matches

      public static boolean matches​(@Nonnull String pattern, @Nonnull String text)
      matches a string to pattern where * can be 0-n unknown characters and ? can be exactly 1 character
       
       Wildcard.matches("Te?t","Test") -> true
       Wildcard.matches("Te?t","Tesst") -> false
       Wildcard.matches("Te*t","Tesst") -> true
       Wildcard.matches("Te*t","Test") -> true
       Wildcard.matches("Tet","Test") -> true
       
       
      Parameters:
      pattern - the pattern to use
      text - the text to match against
      Returns: