Class JdkRegexpMatcher

java.lang.Object
org.kordamp.json.regexp.JdkRegexpMatcher
All Implemented Interfaces:
RegexpMatcher

public class JdkRegexpMatcher extends Object implements RegexpMatcher
JDK 1.4+ RegexpMatcher implementation.
  • Field Details

    • pattern

      private final Pattern pattern
  • Constructor Details

    • JdkRegexpMatcher

      public JdkRegexpMatcher(String pattern)
    • JdkRegexpMatcher

      public JdkRegexpMatcher(String pattern, boolean multiline)
  • Method Details

    • getGroupIfMatches

      public String getGroupIfMatches(String str, int group)
      Description copied from interface: RegexpMatcher
      Returns the specified group if the string matches the Pattern.
      The Pattern will be managed internally by the RegexpMatcher implementation.
      Specified by:
      getGroupIfMatches in interface RegexpMatcher
    • matches

      public boolean matches(String str)
      Description copied from interface: RegexpMatcher
      Returns true is the string matches the Pattern.
      The Pattern will be managed internally by the RegexpMatcher implementation.
      Specified by:
      matches in interface RegexpMatcher