字符串正则表达式#
- 分组 正则表达式
枚举
函数
-
constexpr bool is_multiline(regex_flags const f)#
如果给定的标志包含 MULTILINE,则返回 true。
- 参数:
f – 要检查的正则表达式标志
- 返回:
如果
f
包含 MULTILINE,则返回 true
-
constexpr bool is_dotall(regex_flags const f)#
如果给定的标志包含 DOTALL,则返回 true。
- 参数:
f – 要检查的正则表达式标志
- 返回:
如果
f
包含 DOTALL,则返回 true
-
constexpr bool is_ascii(regex_flags const f)#
如果给定的标志包含 ASCII,则返回 true。
- 参数:
f – 要检查的正则表达式标志
- 返回:
如果
f
包含 ASCII,则返回 true
-
constexpr bool is_ext_newline(regex_flags const f)#
如果给定的标志包含 EXT_NEWLINE,则返回 true。
- 参数:
f – 要检查的正则表达式标志
- 返回:
如果
f
包含 EXT_NEWLINE,则返回 true
-
struct regex_program#
- #include <regex_program.hpp>
正则表达式程序类。
从正则表达式模式创建实例,并使用它来调用相应的字符串 API。实例可以重复使用。
有关支持正则表达式的模式和 API 的详细信息,请参阅正则表达式特性页面。
公共函数
-
regex_program(regex_program &&other)#
移动构造函数。
- 参数:
other – 要移动的源对象
-
regex_program &operator=(regex_program &&other)#
移动赋值运算符。
- 参数:
other – 要移动的源对象
- 返回:
此对象
-
std::string pattern() const#
返回用于创建此实例的模式。
- 返回:
作为字符串的正则表达式模式
-
regex_flags flags() const#
返回用于创建此实例的正则表达式标志。
- 返回:
正则表达式标志设置
-
capture_groups capture() const#
返回用于创建此实例的捕获组设置。
- 返回:
捕获组设置
-
int32_t instructions_count() const#
返回此实例中的指令数量。
- 返回:
指令数量
-
int32_t groups_count() const#
返回此实例中的捕获组数量。
- 返回:
组数量
-
std::size_t compute_working_memory_size(int32_t num_strings) const#
返回正则表达式执行所需的工作内存大小。
- 参数:
num_strings – 用于计算的字符串数量
- 返回:
工作内存大小(字节)
公共静态函数
-
static std::unique_ptr<regex_program> create(std::string_view pattern, regex_flags flags = regex_flags::DEFAULT, capture_groups capture = capture_groups::EXTRACT)#
从模式创建程序。
- 抛出:
cudf::logic_error – 如果模式无效或包含不支持的特性
- 参数:
pattern – 正则表达式模式
flags – 用于解释模式中特殊字符的正则表达式标志
capture – 控制模式中捕获组的使用方式
- 返回:
此对象的实例
-
regex_program(regex_program &&other)#
-
constexpr bool is_multiline(regex_flags const f)#