JPCRE2  10.31.02
C++ wrapper for PCRE2 library
jpcre2::select< Char_T, Map >::RegexMatch Class Reference

Provides public constructors to create RegexMatch objects. More...

#include <jpcre2.hpp>

Public Member Functions

 RegexMatch ()
 Default constructor. More...
 
 RegexMatch (Regex const *r)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. ... More...
 
 RegexMatch (RegexMatch const &rm)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. ... More...
 
virtual RegexMatchoperator= (RegexMatch const &rm)
 Overloaded copy-assignment operator. More...
 
 RegexMatch (RegexMatch &&rm)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. ... More...
 
virtual RegexMatchoperator= (RegexMatch &&rm)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. ... More...
 
virtual ~RegexMatch ()
 Destructor Frees all internal memories that were used. More...
 
virtual RegexMatchreset ()
 Reset all class variables to its default (initial) state including memory. More...
 
virtual RegexMatchclear ()
 Clear all class variables (may retain some memory for further use). More...
 
virtual RegexMatchresetErrors ()
 reset match related errors to zero. More...
 
virtual int getErrorNumber () const
 Returns the last error number. More...
 
virtual int getErrorOffset () const
 Returns the last error offset. More...
 
virtual String getErrorMessage () const
 Returns the last error message. More...
 
virtual String getSubject () const
 Get subject string (by value). More...
 
virtual String const * getSubjectPointer () const
 Get pointer to subject string. More...
 
virtual std::string getModifier () const
 Calculate modifier string from PCRE2 and JPCRE2 options and return it. More...
 
virtual ModifierTable const * getModifierTable ()
 Get the modifier table that is set,. More...
 
virtual Uint getPcre2Option () const
 Get PCRE2 option. More...
 
virtual Uint getJpcre2Option () const
 Get JPCRE2 option. More...
 
virtual PCRE2_SIZE getStartOffset () const
 Get offset from where match will start in the subject. More...
 
virtual VecOff const * getMatchStartOffsetVector () const
 Get pre-set match start offset vector pointer. More...
 
virtual VecOff const * getMatchEndOffsetVector () const
 Get pre-set match end offset vector pointer. More...
 
virtual Regex const * getRegexObject () const
 Get a pointer to the associated Regex object. More...
 
virtual VecNum const * getNumberedSubstringVector () const
 Get pointer to numbered substring vector. More...
 
virtual VecNas const * getNamedSubstringVector () const
 Get pointer to named substring vector. More...
 
virtual VecNtN const * getNameToNumberMapVector () const
 Get pointer to name to number map vector. More...
 
virtual RegexMatchsetRegexObject (Regex const *r)
 Set the associated regex object. More...
 
virtual RegexMatchsetNumberedSubstringVector (VecNum *v)
 Set a pointer to the numbered substring vector. More...
 
virtual RegexMatchsetNamedSubstringVector (VecNas *v)
 Set a pointer to the named substring vector. More...
 
virtual RegexMatchsetNameToNumberMapVector (VecNtN *v)
 Set a pointer to the name to number map vector. More...
 
virtual RegexMatchsetMatchStartOffsetVector (VecOff *v)
 Set the pointer to a vector to store the offsets where matches start in the subject. More...
 
virtual RegexMatchsetMatchEndOffsetVector (VecOff *v)
 Set the pointer to a vector to store the offsets where matches end in the subject. More...
 
virtual RegexMatchsetSubject (String const &s)
 Set the subject string for match. More...
 
virtual RegexMatchsetSubject (String const *s)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. ... More...
 
virtual RegexMatchsetModifier (Modifier const &s)
 Set the modifier (resets all JPCRE2 and PCRE2 options) by calling RegexMatch::changeModifier(). More...
 
virtual RegexMatchsetModifierTable (ModifierTable const *mdt)
 Set a custom modifier table to be used. More...
 
virtual RegexMatchsetJpcre2Option (Uint x)
 Set JPCRE2 option for match (resets all) More...
 
virtual RegexMatchsetPcre2Option (Uint x)
 Set PCRE2 option match (overwrite existing option) More...
 
virtual RegexMatchsetFindAll (bool x)
 Set whether to perform global match. More...
 
virtual RegexMatchsetFindAll ()
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. ... More...
 
virtual RegexMatchsetStartOffset (PCRE2_SIZE offset)
 Set offset from where match starts. More...
 
virtual RegexMatchsetMatchContext (MatchContext *match_context)
 Set the match context. More...
 
virtual MatchContext * getMatchContext ()
 Return pointer to the match context that was previously set with setMatchContext(). More...
 
virtual RegexMatchsetMatchDataBlock (MatchData *madt)
 Set the match data block to be used. More...
 
virtual MatchData * getMatchDataBlock ()
 Get the pointer to the match data block that was set previously with setMatchData() Handling memory is the callers' responsibility. More...
 
virtual RegexMatchchangeModifier (Modifier const &mod, bool x)
 Parse modifier and add/remove equivalent PCRE2 and JPCRE2 options. More...
 
virtual RegexMatchchangeJpcre2Option (Uint opt, bool x)
 Add or remove a JPCRE2 option. More...
 
virtual RegexMatchchangePcre2Option (Uint opt, bool x)
 Add or remove a PCRE2 option. More...
 
virtual RegexMatchaddModifier (Modifier const &mod)
 Parse modifier string and add equivalent PCRE2 and JPCRE2 options. More...
 
virtual RegexMatchaddJpcre2Option (Uint x)
 Add option to existing JPCRE2 options for match. More...
 
virtual RegexMatchaddPcre2Option (Uint x)
 Add option to existing PCRE2 options for match. More...
 
virtual SIZE_T match (void)
 Perform match operation using info from class variables and return the match count and store the results in specified vectors. More...
 

Detailed Description

template<typename Char_T, template< typename... > class Map = std::map>
class jpcre2::select< Char_T, Map >::RegexMatch

Provides public constructors to create RegexMatch objects.

Every RegexMatch object should be associated with a Regex object. This class stores a pointer to its' associated Regex object, thus when the content of the associated Regex object is changed, there will be no need to set the pointer again.

Examples:

rm.match("subject", "g"); // 0 match
re.compile("\\w");
rm.match(); // 7 matches

Constructor & Destructor Documentation

◆ RegexMatch() [1/4]

template<typename Char_T, template< typename... > class Map = std::map>
jpcre2::select< Char_T, Map >::RegexMatch::RegexMatch ( )
inline

Default constructor.

◆ RegexMatch() [2/4]

template<typename Char_T, template< typename... > class Map = std::map>
jpcre2::select< Char_T, Map >::RegexMatch::RegexMatch ( Regex const *  r)
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. ...

Creates a RegexMatch object associating a Regex object. Underlying data is not modified.

Parameters
rpointer to a Regex object

◆ RegexMatch() [3/4]

template<typename Char_T, template< typename... > class Map = std::map>
jpcre2::select< Char_T, Map >::RegexMatch::RegexMatch ( RegexMatch const &  rm)
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. ...

Copy constructor.

Parameters
rmReference to RegexMatch object

◆ RegexMatch() [4/4]

template<typename Char_T, template< typename... > class Map = std::map>
jpcre2::select< Char_T, Map >::RegexMatch::RegexMatch ( RegexMatch &&  rm)
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. ...

Move constructor. This constructor steals resources from the argument. It leaves the argument in a valid but indeterminate sate. The indeterminate state can be returned to normal by calling reset() on that object.

Parameters
rmrvalue reference to a RegexMatch object

◆ ~RegexMatch()

template<typename Char_T, template< typename... > class Map = std::map>
virtual jpcre2::select< Char_T, Map >::RegexMatch::~RegexMatch ( )
inlinevirtual

Destructor Frees all internal memories that were used.

Member Function Documentation

◆ addJpcre2Option()

template<typename Char_T, template< typename... > class Map = std::map>
virtual RegexMatch& jpcre2::select< Char_T, Map >::RegexMatch::addJpcre2Option ( Uint  x)
inlinevirtual

Add option to existing JPCRE2 options for match.

Parameters
xOption value
Returns
Reference to the calling RegexMatch object
See also
RegexReplace::addJpcre2Option()
Regex::addJpcre2Option()

Reimplemented in jpcre2::select< Char_T, Map >::MatchEvaluator.

◆ addModifier()

template<typename Char_T, template< typename... > class Map = std::map>
virtual RegexMatch& jpcre2::select< Char_T, Map >::RegexMatch::addModifier ( Modifier const &  mod)
inlinevirtual

Parse modifier string and add equivalent PCRE2 and JPCRE2 options.

This is just a wrapper of the original function RegexMatch::changeModifier()

Parameters
modModifier string.
Returns
Reference to the calling RegexMatch object
See also
RegexReplace::addModifier()
Regex::addModifier()

Reimplemented in jpcre2::select< Char_T, Map >::MatchEvaluator.

◆ addPcre2Option()

template<typename Char_T, template< typename... > class Map = std::map>
virtual RegexMatch& jpcre2::select< Char_T, Map >::RegexMatch::addPcre2Option ( Uint  x)
inlinevirtual

Add option to existing PCRE2 options for match.

Parameters
xOption value
Returns
Reference to the calling RegexMatch object
See also
RegexReplace::addPcre2Option()
Regex::addPcre2Option()

Reimplemented in jpcre2::select< Char_T, Map >::MatchEvaluator.

◆ changeJpcre2Option()

template<typename Char_T, template< typename... > class Map = std::map>
virtual RegexMatch& jpcre2::select< Char_T, Map >::RegexMatch::changeJpcre2Option ( Uint  opt,
bool  x 
)
inlinevirtual

Add or remove a JPCRE2 option.

Parameters
optJPCRE2 option value
xAdd the option if it's true, remove otherwise.
Returns
Reference to the calling RegexMatch object
See also
RegexReplace::changeJpcre2Option()
Regex::changeJpcre2Option()

Reimplemented in jpcre2::select< Char_T, Map >::MatchEvaluator.

◆ changeModifier()

template<typename Char_T, template< typename... > class Map = std::map>
virtual RegexMatch& jpcre2::select< Char_T, Map >::RegexMatch::changeModifier ( Modifier const &  mod,
bool  x 
)
inlinevirtual

Parse modifier and add/remove equivalent PCRE2 and JPCRE2 options.

This function does not initialize or re-initialize options. If you want to set options from scratch, initialize them to 0 before calling this function. If invalid modifier is detected, then the error number for the RegexMatch object will be jpcre2::ERROR::INVALID_MODIFIER and error offset will be the modifier character. You can get the message with RegexMatch::getErrorMessage() function.

Parameters
modModifier string.
xWhether to add or remove option
Returns
Reference to the RegexMatch object
See also
Regex::changeModifier()
RegexReplace::changeModifier()

Reimplemented in jpcre2::select< Char_T, Map >::MatchEvaluator.

References jpcre2::ModifierTable::toMatchOption().

+ Here is the call graph for this function:

◆ changePcre2Option()

template<typename Char_T, template< typename... > class Map = std::map>
virtual RegexMatch& jpcre2::select< Char_T, Map >::RegexMatch::changePcre2Option ( Uint  opt,
bool  x 
)
inlinevirtual

Add or remove a PCRE2 option.

Parameters
optPCRE2 option value
xAdd the option if it's true, remove otherwise.
Returns
Reference to the calling RegexMatch object
See also
RegexReplace::changePcre2Option()
Regex::changePcre2Option()

Reimplemented in jpcre2::select< Char_T, Map >::MatchEvaluator.

◆ clear()

template<typename Char_T, template< typename... > class Map = std::map>
virtual RegexMatch& jpcre2::select< Char_T, Map >::RegexMatch::clear ( )
inlinevirtual

Clear all class variables (may retain some memory for further use).

Data in the vectors will retain (as it's external) You will need to pass vector pointers again after calling this function to get match results.

Returns
Reference to the calling RegexMatch object.

Reimplemented in jpcre2::select< Char_T, Map >::MatchEvaluator.

References jpcre2::select< Char_T, Map >::RegexMatch::clear().

Referenced by jpcre2::select< Char_T, Map >::RegexMatch::clear(), and jpcre2::select< Char_T, Map >::RegexMatch::setSubject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getErrorMessage()

template<typename Char_T, template< typename... > class Map = std::map>
virtual String jpcre2::select< Char_T, Map >::RegexMatch::getErrorMessage ( ) const
inlinevirtual

Returns the last error message.

Returns
Last error message

References jpcre2::select< Char_T, Map >::getErrorMessage().

+ Here is the call graph for this function:

◆ getErrorNumber()

template<typename Char_T, template< typename... > class Map = std::map>
virtual int jpcre2::select< Char_T, Map >::RegexMatch::getErrorNumber ( ) const
inlinevirtual

Returns the last error number.

Returns
Last error number

◆ getErrorOffset()

template<typename Char_T, template< typename... > class Map = std::map>
virtual int jpcre2::select< Char_T, Map >::RegexMatch::getErrorOffset ( ) const
inlinevirtual

Returns the last error offset.

Returns
Last error offset

◆ getJpcre2Option()

template<typename Char_T, template< typename... > class Map = std::map>
virtual Uint jpcre2::select< Char_T, Map >::RegexMatch::getJpcre2Option ( ) const
inlinevirtual

Get JPCRE2 option.

Returns
JPCRE2 options for math operation
See also
Regex::getJpcre2Option()
RegexReplace::getJpcre2Option()

◆ getMatchContext()

template<typename Char_T, template< typename... > class Map = std::map>
virtual MatchContext* jpcre2::select< Char_T, Map >::RegexMatch::getMatchContext ( )
inlinevirtual

Return pointer to the match context that was previously set with setMatchContext().

Handling memory is the callers' responsibility.

Returns
pointer to the match context (default: null).

◆ getMatchDataBlock()

template<typename Char_T, template< typename... > class Map = std::map>
virtual MatchData* jpcre2::select< Char_T, Map >::RegexMatch::getMatchDataBlock ( )
inlinevirtual

Get the pointer to the match data block that was set previously with setMatchData() Handling memory is the callers' responsibility.

Returns
pointer to the match data (default: null).

◆ getMatchEndOffsetVector()

template<typename Char_T, template< typename... > class Map = std::map>
virtual VecOff const* jpcre2::select< Char_T, Map >::RegexMatch::getMatchEndOffsetVector ( ) const
inlinevirtual

Get pre-set match end offset vector pointer.

The pointer must be set with RegexMatch::setMatchEndOffsetVector() beforehand for this to work i.e it is just a convenience method to get the pre-set vector pointer.

Returns
pointer to the const end offset vector

◆ getMatchStartOffsetVector()

template<typename Char_T, template< typename... > class Map = std::map>
virtual VecOff const* jpcre2::select< Char_T, Map >::RegexMatch::getMatchStartOffsetVector ( ) const
inlinevirtual

Get pre-set match start offset vector pointer.

The pointer must be set with RegexMatch::setMatchStartOffsetVector() beforehand for this to work i.e it is just a convenience method to get the pre-set vector pointer.

Returns
pointer to the const match start offset vector

◆ getModifier()

template<typename Char_T, template< typename... > class Map = std::map>
virtual std::string jpcre2::select< Char_T, Map >::RegexMatch::getModifier ( ) const
inlinevirtual

Calculate modifier string from PCRE2 and JPCRE2 options and return it.

Do remember that modifiers (or PCRE2 and JPCRE2 options) do not change or get initialized as long as you don't do that explicitly. Calling RegexMatch::setModifier() will re-set them.

Mixed or combined modifier.

Some modifier may include other modifiers i.e they have the same meaning of some modifiers combined together. For example, the 'n' modifier includes the 'u' modifier and together they are equivalent to PCRE2_UTF | PCRE2_UCP. When you set a modifier like this, both options get set, and when you remove the 'n' modifier (with RegexMatch::changeModifier()), both will get removed.

Returns
Calculated modifier string (std::string)
See also
Regex::getModifier()
RegexReplace::getModifier()

References jpcre2::ModifierTable::fromMatchOption().

+ Here is the call graph for this function:

◆ getModifierTable()

template<typename Char_T, template< typename... > class Map = std::map>
virtual ModifierTable const* jpcre2::select< Char_T, Map >::RegexMatch::getModifierTable ( )
inlinevirtual

Get the modifier table that is set,.

Returns
pointer to constant ModifierTable.

◆ getNamedSubstringVector()

template<typename Char_T, template< typename... > class Map = std::map>
virtual VecNas const* jpcre2::select< Char_T, Map >::RegexMatch::getNamedSubstringVector ( ) const
inlinevirtual

Get pointer to named substring vector.

Returns
Pointer to const named substring vector.

◆ getNameToNumberMapVector()

template<typename Char_T, template< typename... > class Map = std::map>
virtual VecNtN const* jpcre2::select< Char_T, Map >::RegexMatch::getNameToNumberMapVector ( ) const
inlinevirtual

Get pointer to name to number map vector.

Returns
Pointer to const name to number map vector.

◆ getNumberedSubstringVector()

template<typename Char_T, template< typename... > class Map = std::map>
virtual VecNum const* jpcre2::select< Char_T, Map >::RegexMatch::getNumberedSubstringVector ( ) const
inlinevirtual

Get pointer to numbered substring vector.

Returns
Pointer to const numbered substring vector.

◆ getPcre2Option()

template<typename Char_T, template< typename... > class Map = std::map>
virtual Uint jpcre2::select< Char_T, Map >::RegexMatch::getPcre2Option ( ) const
inlinevirtual

Get PCRE2 option.

Returns
PCRE2 option for match operation
See also
Regex::getPcre2Option()
RegexReplace::getPcre2Option()

◆ getRegexObject()

template<typename Char_T, template< typename... > class Map = std::map>
virtual Regex const* jpcre2::select< Char_T, Map >::RegexMatch::getRegexObject ( ) const
inlinevirtual

Get a pointer to the associated Regex object.

If no actual Regex object is associated, null is returned.

Returns
A pointer to the associated constant Regex object or null.

◆ getStartOffset()

template<typename Char_T, template< typename... > class Map = std::map>
virtual PCRE2_SIZE jpcre2::select< Char_T, Map >::RegexMatch::getStartOffset ( ) const
inlinevirtual

Get offset from where match will start in the subject.

Returns
Start offset

◆ getSubject()

template<typename Char_T, template< typename... > class Map = std::map>
virtual String jpcre2::select< Char_T, Map >::RegexMatch::getSubject ( ) const
inlinevirtual

Get subject string (by value).

Returns
subject string
See also
RegexReplace::getSubject()

◆ getSubjectPointer()

template<typename Char_T, template< typename... > class Map = std::map>
virtual String const* jpcre2::select< Char_T, Map >::RegexMatch::getSubjectPointer ( ) const
inlinevirtual

Get pointer to subject string.

Data can not be changed with this pointer.

Returns
constant subject string pointer
See also
RegexReplace::getSubjectPointer()

◆ match()

template<typename Char_T , template< typename... > class Map>
jpcre2::SIZE_T jpcre2::select< Char_T, Map >::RegexMatch::match ( void  )
virtual

Perform match operation using info from class variables and return the match count and store the results in specified vectors.

Note: This function uses pcre2_match() function to do the match.

Returns
Match count

Reimplemented in jpcre2::select< Char_T, Map >::MatchEvaluator.

◆ operator=() [1/2]

template<typename Char_T, template< typename... > class Map = std::map>
virtual RegexMatch& jpcre2::select< Char_T, Map >::RegexMatch::operator= ( RegexMatch const &  rm)
inlinevirtual

Overloaded copy-assignment operator.

Parameters
rmRegexMatch object
Returns
A reference to the calling RegexMatch object.

◆ operator=() [2/2]

template<typename Char_T, template< typename... > class Map = std::map>
virtual RegexMatch& jpcre2::select< Char_T, Map >::RegexMatch::operator= ( RegexMatch &&  rm)
inlinevirtual

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. ...

Overloaded move-assignment operator. This constructor steals resources from the argument. It leaves the argument in a valid but indeterminate sate. The indeterminate state can be returned to normal by calling reset() on that object.

Parameters
rmrvalue reference to a RegexMatch object
Returns
A reference to the calling RegexMatch object.

◆ reset()

template<typename Char_T, template< typename... > class Map = std::map>
virtual RegexMatch& jpcre2::select< Char_T, Map >::RegexMatch::reset ( )
inlinevirtual

Reset all class variables to its default (initial) state including memory.

Data in the vectors will retain (as it's external) You will need to pass vector pointers again after calling this function to get match results.

Returns
Reference to the calling RegexMatch object.

Reimplemented in jpcre2::select< Char_T, Map >::MatchEvaluator.

◆ resetErrors()

template<typename Char_T, template< typename... > class Map = std::map>
virtual RegexMatch& jpcre2::select< Char_T, Map >::RegexMatch::resetErrors ( )
inlinevirtual

reset match related errors to zero.

If you want to examine the error status of a function call in the method chain, add this function just before your target function so that the error is set to zero before that target function is called, and leave everything out after the target function so that there will be no additional errors from other function calls.

Returns
A reference to the RegexMatch object
See also
Regex::resetErrors()
RegexReplace::resetErrors()

Reimplemented in jpcre2::select< Char_T, Map >::MatchEvaluator.

◆ setFindAll() [1/2]

template<typename Char_T, template< typename... > class Map = std::map>
virtual RegexMatch& jpcre2::select< Char_T, Map >::RegexMatch::setFindAll ( bool  x)
inlinevirtual

Set whether to perform global match.

Parameters
xTrue or False
Returns
Reference to the calling RegexMatch object

Reimplemented in jpcre2::select< Char_T, Map >::MatchEvaluator.

References jpcre2::FIND_ALL.

◆ setFindAll() [2/2]

template<typename Char_T, template< typename... > class Map = std::map>
virtual RegexMatch& jpcre2::select< Char_T, Map >::RegexMatch::setFindAll ( )
inlinevirtual

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. ...

This function just calls RegexMatch::setFindAll(bool x) with true as the parameter

Returns
Reference to the calling RegexMatch object

Reimplemented in jpcre2::select< Char_T, Map >::MatchEvaluator.

◆ setJpcre2Option()

template<typename Char_T, template< typename... > class Map = std::map>
virtual RegexMatch& jpcre2::select< Char_T, Map >::RegexMatch::setJpcre2Option ( Uint  x)
inlinevirtual

Set JPCRE2 option for match (resets all)

Parameters
xOption value
Returns
Reference to the calling RegexMatch object
See also
RegexReplace::setJpcre2Option()
Regex::setJpcre2Option()

Reimplemented in jpcre2::select< Char_T, Map >::MatchEvaluator.

◆ setMatchContext()

template<typename Char_T, template< typename... > class Map = std::map>
virtual RegexMatch& jpcre2::select< Char_T, Map >::RegexMatch::setMatchContext ( MatchContext *  match_context)
inlinevirtual

Set the match context.

You can create match context using the native PCRE2 API. The memory is not handled by RegexMatch object and not freed. User will be responsible for freeing the memory of the match context.

Parameters
match_contextPointer to the match context.
Returns
Reference to the calling RegexMatch object

Reimplemented in jpcre2::select< Char_T, Map >::MatchEvaluator.

◆ setMatchDataBlock()

template<typename Char_T, template< typename... > class Map = std::map>
virtual RegexMatch& jpcre2::select< Char_T, Map >::RegexMatch::setMatchDataBlock ( MatchData *  madt)
inlinevirtual

Set the match data block to be used.

The memory is not handled by RegexMatch object and not freed. User will be responsible for freeing the memory of the match data block.

Parameters
madtPointer to a match data block.
Returns
Reference to the calling RegexMatch object

Reimplemented in jpcre2::select< Char_T, Map >::MatchEvaluator.

◆ setMatchEndOffsetVector()

template<typename Char_T, template< typename... > class Map = std::map>
virtual RegexMatch& jpcre2::select< Char_T, Map >::RegexMatch::setMatchEndOffsetVector ( VecOff v)
inlinevirtual

Set the pointer to a vector to store the offsets where matches end in the subject.

Null pointer unsets it.

Parameters
vPointer to a VecOff vector (std::vector<size_t>)
Returns
Reference to the calling RegexMatch object

◆ setMatchStartOffsetVector()

template<typename Char_T, template< typename... > class Map = std::map>
virtual RegexMatch& jpcre2::select< Char_T, Map >::RegexMatch::setMatchStartOffsetVector ( VecOff v)
inlinevirtual

Set the pointer to a vector to store the offsets where matches start in the subject.

Null pointer unsets it.

Parameters
vPointer to a jpcre2::VecOff vector (std::vector<size_t>)
Returns
Reference to the calling RegexMatch object

◆ setModifier()

template<typename Char_T, template< typename... > class Map = std::map>
virtual RegexMatch& jpcre2::select< Char_T, Map >::RegexMatch::setModifier ( Modifier const &  s)
inlinevirtual

Set the modifier (resets all JPCRE2 and PCRE2 options) by calling RegexMatch::changeModifier().

Re-initializes the option bits for PCRE2 and JPCRE2 options, then parses the modifier to set their equivalent options.

Parameters
sModifier string.
Returns
Reference to the calling RegexMatch object
See also
RegexReplace::setModifier()
Regex::setModifier()

Reimplemented in jpcre2::select< Char_T, Map >::MatchEvaluator.

◆ setModifierTable()

template<typename Char_T, template< typename... > class Map = std::map>
virtual RegexMatch& jpcre2::select< Char_T, Map >::RegexMatch::setModifierTable ( ModifierTable const *  mdt)
inlinevirtual

Set a custom modifier table to be used.

Parameters
mdtpointer to ModifierTable object.
Returns
Reference to the calling RegexMatch object.

Reimplemented in jpcre2::select< Char_T, Map >::MatchEvaluator.

◆ setNamedSubstringVector()

template<typename Char_T, template< typename... > class Map = std::map>
virtual RegexMatch& jpcre2::select< Char_T, Map >::RegexMatch::setNamedSubstringVector ( VecNas v)
inlinevirtual

Set a pointer to the named substring vector.

Null pointer unsets it.

This vector will be populated with named captured groups.

Parameters
vpointer to the named substring vector
Returns
Reference to the calling RegexMatch object

◆ setNameToNumberMapVector()

template<typename Char_T, template< typename... > class Map = std::map>
virtual RegexMatch& jpcre2::select< Char_T, Map >::RegexMatch::setNameToNumberMapVector ( VecNtN v)
inlinevirtual

Set a pointer to the name to number map vector.

Null pointer unsets it.

This vector will be populated with name to number map for captured groups.

Parameters
vpointer to the name to number map vector
Returns
Reference to the calling RegexMatch object

◆ setNumberedSubstringVector()

template<typename Char_T, template< typename... > class Map = std::map>
virtual RegexMatch& jpcre2::select< Char_T, Map >::RegexMatch::setNumberedSubstringVector ( VecNum v)
inlinevirtual

Set a pointer to the numbered substring vector.

Null pointer unsets it.

This vector will be filled with numbered (indexed) captured groups.

Parameters
vpointer to the numbered substring vector
Returns
Reference to the calling RegexMatch object

◆ setPcre2Option()

template<typename Char_T, template< typename... > class Map = std::map>
virtual RegexMatch& jpcre2::select< Char_T, Map >::RegexMatch::setPcre2Option ( Uint  x)
inlinevirtual

Set PCRE2 option match (overwrite existing option)

Parameters
xOption value
Returns
Reference to the calling RegexMatch object
See also
RegexReplace::setPcre2Option()
Regex::setPcre2Option()

Reimplemented in jpcre2::select< Char_T, Map >::MatchEvaluator.

◆ setRegexObject()

template<typename Char_T, template< typename... > class Map = std::map>
virtual RegexMatch& jpcre2::select< Char_T, Map >::RegexMatch::setRegexObject ( Regex const *  r)
inlinevirtual

Set the associated regex object.

Null pointer unsets it. Underlying data is not modified.

Parameters
rPointer to a Regex object.
Returns
Reference to the calling RegexMatch object.

Reimplemented in jpcre2::select< Char_T, Map >::MatchEvaluator.

◆ setStartOffset()

template<typename Char_T, template< typename... > class Map = std::map>
virtual RegexMatch& jpcre2::select< Char_T, Map >::RegexMatch::setStartOffset ( PCRE2_SIZE  offset)
inlinevirtual

Set offset from where match starts.

When FIND_ALL is set, a global match would not be performed on all positions on the subject, rather it will be performed from the start offset and onwards.

Parameters
offsetStart offset
Returns
Reference to the calling RegexMatch object

Reimplemented in jpcre2::select< Char_T, Map >::MatchEvaluator.

◆ setSubject() [1/2]

template<typename Char_T, template< typename... > class Map = std::map>
virtual RegexMatch& jpcre2::select< Char_T, Map >::RegexMatch::setSubject ( String const &  s)
inlinevirtual

Set the subject string for match.

This makes a copy of the subject string.

Parameters
sSubject string
Returns
Reference to the calling RegexMatch object
See also
RegexReplace::setSubject()

Reimplemented in jpcre2::select< Char_T, Map >::MatchEvaluator.

◆ setSubject() [2/2]

template<typename Char_T, template< typename... > class Map = std::map>
virtual RegexMatch& jpcre2::select< Char_T, Map >::RegexMatch::setSubject ( String const *  s)
inlinevirtual

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. ...

Works with the original without modifying it. Null pointer unsets the subject.

Parameters
sPointer to subject string
Returns
Reference to the calling RegexMatch object
See also
RegexReplace::setSubject()

Reimplemented in jpcre2::select< Char_T, Map >::MatchEvaluator.

References jpcre2::select< Char_T, Map >::RegexMatch::clear().

+ Here is the call graph for this function: