Uses of Class
java.util.regex.Pattern
Packages that usePattern Package Description java.util Contains the collections framework, some internationalization support classes, a service loader, properties, random number generation, string parsing and scanning classes, base64 encoding and decoding, a bit array, and several miscellaneous utility classes.java.util.regex Classes for matching character sequences against patterns specified by regular expressions.Uses ofPattern injava.util
Methods injava.util that returnPattern Modifier and Type Method Description PatternScanner. delimiter()Returns thePatternthisScanneris currently using to match delimiters.Methods injava.util with parameters of typePattern Modifier and Type Method Description Stream<MatchResult>Scanner. findAll(Pattern pattern)Returns a stream of match results from this scanner.StringScanner. findInLine(Pattern pattern)Attempts to find the next occurrence of the specified pattern ignoring delimiters.StringScanner. findWithinHorizon(Pattern pattern, int horizon)Attempts to find the next occurrence of the specified pattern.booleanScanner. hasNext(Pattern pattern)Returns true if the next complete token matches the specified pattern.StringScanner. next(Pattern pattern)Returns the next token if it matches the specified pattern.ScannerScanner. skip(Pattern pattern)Skips input that matches the specified pattern, ignoring delimiters.ScannerScanner. useDelimiter(Pattern pattern)Sets this scanner's delimiting pattern to the specified pattern.Uses ofPattern injava.util.regex
Methods injava.util.regex that returnPattern Modifier and Type Method Description staticPatternPattern. compile(String regex)Compiles the given regular expression into a pattern.staticPatternPattern. compile(String regex, int flags)Compiles the given regular expression into a pattern with the given flags.PatternMatcher. pattern()Returns the pattern that is interpreted by this matcher.Methods injava.util.regex with parameters of typePattern Modifier and Type Method Description MatcherMatcher. usePattern(Pattern newPattern)Changes thePatternthat thisMatcheruses to find matches with.