Public Member Functions | Static Public Member Functions | Friends | List of all members
cudf::strings::regex_program Struct Reference

Regex program class. More...

#include <regex_program.hpp>

Public Member Functions

 regex_program (regex_program &&other)
 Move constructor. More...
 
regex_programoperator= (regex_program &&other)
 Move operator assignment. More...
 
std::string pattern () const
 Return the pattern used to create this instance. More...
 
regex_flags flags () const
 Return the regex_flags used to create this instance. More...
 
capture_groups capture () const
 Return the capture_groups used to create this instance. More...
 
int32_t instructions_count () const
 Return the number of instructions in this instance. More...
 
int32_t groups_count () const
 Return the number of capture groups in this instance. More...
 
std::size_t compute_working_memory_size (int32_t num_strings) const
 Return the size of the working memory for the regex execution. More...
 

Static Public Member Functions

static std::unique_ptr< regex_programcreate (std::string_view pattern, regex_flags flags=regex_flags::DEFAULT, capture_groups capture=capture_groups::EXTRACT)
 Create a program from a pattern. More...
 

Friends

struct regex_device_builder
 

Detailed Description

Regex program class.

Create an instance from a regex pattern and use it to call the appropriate strings APIs. An instance can be reused.

See the Regex Features page for details on patterns and APIs that support regex.

Definition at line 40 of file regex_program.hpp.

Constructor & Destructor Documentation

◆ regex_program()

cudf::strings::regex_program::regex_program ( regex_program &&  other)

Move constructor.

Parameters
otherObject to move from

Member Function Documentation

◆ capture()

capture_groups cudf::strings::regex_program::capture ( ) const

Return the capture_groups used to create this instance.

Returns
capture groups setting

◆ compute_working_memory_size()

std::size_t cudf::strings::regex_program::compute_working_memory_size ( int32_t  num_strings) const

Return the size of the working memory for the regex execution.

Parameters
num_stringsNumber of strings for computation
Returns
Size of the working memory in bytes

◆ create()

static std::unique_ptr<regex_program> cudf::strings::regex_program::create ( std::string_view  pattern,
regex_flags  flags = regex_flags::DEFAULT,
capture_groups  capture = capture_groups::EXTRACT 
)
static

Create a program from a pattern.

Exceptions
cudf::logic_errorIf pattern is invalid or contains unsupported features
Parameters
patternRegex pattern
flagsRegex flags for interpreting special characters in the pattern
captureControls how capture groups in the pattern are used
Returns
Instance of this object

◆ flags()

regex_flags cudf::strings::regex_program::flags ( ) const

Return the regex_flags used to create this instance.

Returns
regex flags setting

◆ groups_count()

int32_t cudf::strings::regex_program::groups_count ( ) const

Return the number of capture groups in this instance.

Returns
Number of groups

◆ instructions_count()

int32_t cudf::strings::regex_program::instructions_count ( ) const

Return the number of instructions in this instance.

Returns
Number of instructions

◆ operator=()

regex_program& cudf::strings::regex_program::operator= ( regex_program &&  other)

Move operator assignment.

Parameters
otherObject to move from
Returns
this object

◆ pattern()

std::string cudf::strings::regex_program::pattern ( ) const

Return the pattern used to create this instance.

Returns
regex pattern as a string

The documentation for this struct was generated from the following file: