类 Patterns


  • public class Patterns
    extends java.lang.Object
    Utils method for pattern
    • 构造器概要

      构造器 
      构造器 说明
      Patterns()  
    • 方法概要

      所有方法 静态方法 具体方法 
      修饰符和类型 方法 说明
      static java.util.List<java.lang.String> getAllMatched​(java.util.regex.Pattern pattern, java.lang.String text)
      Match the text with pattern, get all matched group as strings.
      static java.util.List<java.lang.String> getAllMatched​(java.util.regex.Pattern pattern, java.lang.String text, int groupIndex)
      Match the text with pattern, get all matched group as strings.
      static java.util.List<java.lang.String> getAllMatched​(java.util.regex.Pattern pattern, java.lang.String text, java.lang.String groupName)
      Match the text with pattern, get all matched group as strings.
      static java.util.stream.Stream<java.lang.String> matched​(java.util.regex.Pattern pattern, java.lang.String text)
      Match the text with pattern, wrap the match result as Stream.
      static java.util.stream.Stream<java.lang.String> matched​(java.util.regex.Pattern pattern, java.lang.String text, int groupIndex)
      Match the text with pattern, wrap the match result as Stream.
      • 从类继承的方法 java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 构造器详细资料

      • Patterns

        public Patterns()
    • 方法详细资料

      • matched

        public static java.util.stream.Stream<java.lang.String> matched​(java.util.regex.Pattern pattern,
                                                                        java.lang.String text)
        Match the text with pattern, wrap the match result as Stream.
        参数:
        pattern - the regex pattern to find matcher
        text - the target text
        返回:
        matched string stream
      • matched

        public static java.util.stream.Stream<java.lang.String> matched​(java.util.regex.Pattern pattern,
                                                                        java.lang.String text,
                                                                        int groupIndex)
        Match the text with pattern, wrap the match result as Stream.
        参数:
        pattern - the regex pattern to find matcher
        text - the target text
        groupIndex - the index of a capturing group in this matcher's pattern
        返回:
        matched string stream
      • getAllMatched

        public static java.util.List<java.lang.String> getAllMatched​(java.util.regex.Pattern pattern,
                                                                     java.lang.String text)
        Match the text with pattern, get all matched group as strings.
        参数:
        pattern - the regex pattern to find matcher
        text - the target text
        返回:
        matched strings
      • getAllMatched

        public static java.util.List<java.lang.String> getAllMatched​(java.util.regex.Pattern pattern,
                                                                     java.lang.String text,
                                                                     int groupIndex)
        Match the text with pattern, get all matched group as strings.
        参数:
        pattern - the regex pattern to find matcher
        text - the target text
        groupIndex - the index of a capturing group in this matcher's pattern
        返回:
        matched strings
      • getAllMatched

        public static java.util.List<java.lang.String> getAllMatched​(java.util.regex.Pattern pattern,
                                                                     java.lang.String text,
                                                                     java.lang.String groupName)
        Match the text with pattern, get all matched group as strings.
        参数:
        pattern - the regex pattern to find matcher
        text - the target text
        groupName - the name of a named-capturing group in this matcher's pattern
        返回:
        matched strings