Package com.nuix.superutilities.regex
Class RegexMatch
- java.lang.Object
-
- com.nuix.superutilities.regex.RegexMatch
-
public class RegexMatch extends java.lang.ObjectRepresents information about a regular expression match.
-
-
Constructor Summary
Constructors Constructor Description RegexMatch(PatternInfo patternInfo, java.lang.String location, boolean isContentMatch, java.lang.String value, java.lang.String valueContext, int matchStart, int matchEnd)Creates a new instance
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetExpression()Convenience method for obtaining the regular expression string from the associatedPatternInfoobject.java.lang.StringgetLocation()Gets the location of match such as content or metdata property name.longgetMatchEnd()Gets the offset in source text where match endslonggetMatchStart()Gets the offset in source text where match startsPatternInfogetPatternInfo()Gets the associatedPatternInfoobject which made the match.java.lang.StringgetValue()Gets the matched valuejava.lang.StringgetValueContext()Gets contextual string of match if one was providedbooleanisContentMatch()Gets whether this match was made in the content text of an item.
-
-
-
Constructor Detail
-
RegexMatch
public RegexMatch(PatternInfo patternInfo, java.lang.String location, boolean isContentMatch, java.lang.String value, java.lang.String valueContext, int matchStart, int matchEnd)
Creates a new instance- Parameters:
patternInfo- The pattern which made the matchlocation- Where the match was made (content or metadata property name)isContentMatch- True if the match was made on item content textvalue- The matched valuevalueContext- Contextual text around matchmatchStart- Offset in source text where match startsmatchEnd- Offset in source text where match ends
-
-
Method Detail
-
getExpression
public java.lang.String getExpression()
Convenience method for obtaining the regular expression string from the associatedPatternInfoobject.- Returns:
- The regular expression string from the associated
PatternInfoobject
-
getPatternInfo
public PatternInfo getPatternInfo()
Gets the associatedPatternInfoobject which made the match.- Returns:
- The associated
PatternInfoobject which made the match
-
getLocation
public java.lang.String getLocation()
Gets the location of match such as content or metdata property name.- Returns:
- The location of match such as content or metdata property name
-
isContentMatch
public boolean isContentMatch()
Gets whether this match was made in the content text of an item.- Returns:
- True if this match was made in the content text of an item.
-
getValue
public java.lang.String getValue()
Gets the matched value- Returns:
- The matched value
-
getMatchStart
public long getMatchStart()
Gets the offset in source text where match starts- Returns:
- The offset in source text where match starts
-
getMatchEnd
public long getMatchEnd()
Gets the offset in source text where match ends- Returns:
- The offset in source text where match ends
-
getValueContext
public java.lang.String getValueContext()
Gets contextual string of match if one was provided- Returns:
- The context string of match if one was provided
-
-