public class DoNotUseThisRegexUtil
extends java.lang.Object
Constructor and Description |
---|
DoNotUseThisRegexUtil() |
Modifier and Type | Method and Description |
---|---|
static java.util.regex.MatchResult |
findMatchResult(java.util.regex.Pattern pattern,
java.lang.String target)
Convenience method for simply finding the first occurrence of a particular pattern in the target string
|
static java.util.regex.MatchResult |
findMatchResult(java.lang.String regex,
java.lang.String target)
Convenience method for simply finding the first occurrence of a particular regex in the target string
|
static java.util.regex.Pattern |
getPattern(java.lang.String regex) |
public static java.util.regex.Pattern getPattern(java.lang.String regex) throws java.util.regex.PatternSyntaxException
java.util.regex.PatternSyntaxException
public static java.util.regex.MatchResult findMatchResult(java.lang.String regex, java.lang.String target) throws java.util.regex.PatternSyntaxException
regex
- The regular expression to use for searchingtarget
- the target stringMatchResult
object containing information about the first match in the target string, or
null if the target string does not contain a matchjava.util.regex.PatternSyntaxException
- if regex is an invalid regular expressionpublic static java.util.regex.MatchResult findMatchResult(java.util.regex.Pattern pattern, java.lang.String target)
pattern
- The pattern instance to use for searchingtarget
- the target stringMatchResult
object containing information about the first match in the target string, or
null if the target string does not contain a matchCopyright © 1998-2014 CA, Inc. All Rights Reserved.