Class RegExUtil


  • public class RegExUtil
    extends java.lang.Object
    Utility class for regular expressions.
    • Constructor Summary

      Constructors 
      Constructor Description
      RegExUtil()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.regex.Pattern convertGlobToRegex​(java.lang.String pattern)
      Converts a standard POSIX Shell globbing pattern into a regular expression pattern.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • RegExUtil

        public RegExUtil()
    • Method Detail

      • convertGlobToRegex

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

        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.