Class RegexUtil


  • public class RegexUtil
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      RegexUtil()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String replaceMatch​(java.lang.String replacePattern, java.lang.String data)  
      static java.lang.String replaceVersion​(java.lang.String regex)  
      static java.lang.String simpleMatch​(java.util.regex.Pattern pattern, java.lang.String data)  
      • 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

      • simpleMatch

        public static java.lang.String simpleMatch​(java.util.regex.Pattern pattern,
                                                   java.lang.String data)
        Parameters:
        pattern - Pattern to find containing a single group to match. The group is mark in parentheses.
        data - The source of data to process (URI, filename, js content, ..)
        Returns:
        Match of the first group extract
      • replaceMatch

        public static java.lang.String replaceMatch​(java.lang.String replacePattern,
                                                    java.lang.String data)
        Parameters:
        replacePattern - The format expected is /(FIND_SOMETHING)/(REPLACE_BY_SOMETHING)/
        data - The source of data to process (URI, filename, js content, ..)
        Returns:
        Match of the first group extract
      • replaceVersion

        public static java.lang.String replaceVersion​(java.lang.String regex)