Package com.nuix.superutilities.regex
Class RegexMatch
- java.lang.Object
-
- com.nuix.superutilities.regex.RegexMatch
-
public class RegexMatch extends java.lang.Object
Represents 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.String
getExpression()
Convenience method for obtaining the regular expression string from the associatedPatternInfo
object.java.lang.String
getLocation()
Gets the location of match such as content or metdata property name.long
getMatchEnd()
Gets the offset in source text where match endslong
getMatchStart()
Gets the offset in source text where match startsPatternInfo
getPatternInfo()
Gets the associatedPatternInfo
object which made the match.java.lang.String
getValue()
Gets the matched valuejava.lang.String
getValueContext()
Gets contextual string of match if one was providedboolean
isContentMatch()
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 associatedPatternInfo
object.- Returns:
- The regular expression string from the associated
PatternInfo
object
-
getPatternInfo
public PatternInfo getPatternInfo()
Gets the associatedPatternInfo
object which made the match.- Returns:
- The associated
PatternInfo
object 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
-
-