Class RegexReplace

Inheritance Relationships

Base Type

Class Documentation

class RegexReplace : public mindspore::dataset::TensorTransform

Replace a UTF-8 string tensor with ‘replace’ according to regular expression ‘pattern’.

Public Functions

inline RegexReplace(std::string pattern, std::string replace, bool replace_all = true)

Constructor.

Parameters
  • pattern[in] The regex expression patterns.

  • replace[in] The string to replace the matched element.

  • replace_all[in] Confirm whether to replace all. If false, only replace the first matched element; if true, replace all matched elements (default=true).

RegexReplace(const std::vector<char> &pattern, const std::vector<char> &replace, bool replace_all)

Constructor.

Parameters
  • pattern[in] The regex expression patterns. Type should be char of vector.

  • replace[in] The string to replace the matched element.

  • replace_all[in] Confirm whether to replace all. If false, only replace the first matched element; if true, replace all matched elements (default=true).

~RegexReplace() = default

Destructor.