Class SearchUtils

java.lang.Object
io.fluxcapacitor.common.SearchUtils

public class SearchUtils
extends Object
  • Constructor Details

    • SearchUtils

      public SearchUtils()
  • Method Details

    • convertGlobToRegex

      public static Pattern convertGlobToRegex​(String pattern)
      Converts a standard POSIX Shell globbing pattern into a regular expression pattern. The result can be used with the standard java.util.regex API to recognize strings which match the glob pattern.

      From https://stackoverflow.com/questions/1247772/is-there-an-equivalent-of-java-util-regex-for-glob-type-patterns

      See also, the POSIX Shell language: http://pubs.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html#tag_02_13_01

      Parameters:
      pattern - A glob pattern.
      Returns:
      A regex pattern to recognize the given glob pattern.
    • isInteger

      public static boolean isInteger​(String string)
    • asInteger

      public static Optional<Integer> asInteger​(String string)