Stay organized with collections
Save and categorize content based on your preferences.
tensorflow::ops::RegexReplace
#include <string_ops.h>
Replaces matches of the pattern
regular expression in input
with the replacement string provided in rewrite
.
Summary
It follows the re2 syntax (https://github.com/google/re2/wiki/Syntax)
Args:
- scope: A Scope object
- input: The text to be processed.
- pattern: The regular expression to be matched in the
input
strings.
- rewrite: The rewrite string to be substituted for the
pattern
expression where it is matched in the input
strings.
Optional attributes (see Attrs
):
- replace_global: If True, the replacement is global (that is, all matches of the
pattern
regular expression in each input string are rewritten), otherwise the rewrite
substitution is only made for the first pattern
match.
Returns:
Output
: The text after applying pattern match and rewrite substitution.
Public attributes
Public functions
node
::tensorflow::Node * node() const
operator::tensorflow::Input() const
operator::tensorflow::Output
operator::tensorflow::Output() const
Public static functions
ReplaceGlobal
Attrs ReplaceGlobal(
bool x
)
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates. Some content is licensed under the numpy license.
Last updated 2023-10-06 UTC.
[null,null,["Last updated 2023-10-06 UTC."],[],[],null,["# tensorflow::ops::RegexReplace Class Reference\n\ntensorflow::ops::RegexReplace\n=============================\n\n`#include \u003cstring_ops.h\u003e`\n\nReplaces matches of the `pattern` regular expression in `input` with the replacement string provided in `rewrite`.\n\nSummary\n-------\n\nIt follows the re2 syntax (\u003chttps://github.com/google/re2/wiki/Syntax\u003e)\n\nArgs:\n\n- scope: A [Scope](/versions/r2.14/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope) object\n- input: The text to be processed.\n- pattern: The regular expression to be matched in the `input` strings.\n- rewrite: The rewrite string to be substituted for the `pattern` expression where it is matched in the `input` strings.\n\n\u003cbr /\u003e\n\nOptional attributes (see [Attrs](/versions/r2.14/api_docs/cc/struct/tensorflow/ops/regex-replace/attrs#structtensorflow_1_1ops_1_1_regex_replace_1_1_attrs)):\n\n- replace_global: If True, the replacement is global (that is, all matches of the `pattern` regular expression in each input string are rewritten), otherwise the `rewrite` substitution is only made for the first `pattern` match.\n\n\u003cbr /\u003e\n\nReturns:\n\n- [Output](/versions/r2.14/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output): The text after applying pattern match and rewrite substitution.\n\n\u003cbr /\u003e\n\n| ### Constructors and Destructors ||\n|---|---|\n| [RegexReplace](#classtensorflow_1_1ops_1_1_regex_replace_1a476950575052dd378f93320dfb8abeac)`(const ::`[tensorflow::Scope](/versions/r2.14/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r2.14/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` input, ::`[tensorflow::Input](/versions/r2.14/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` pattern, ::`[tensorflow::Input](/versions/r2.14/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` rewrite)` ||\n| [RegexReplace](#classtensorflow_1_1ops_1_1_regex_replace_1a789bb5399331382a4344de266971b9a1)`(const ::`[tensorflow::Scope](/versions/r2.14/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r2.14/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` input, ::`[tensorflow::Input](/versions/r2.14/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` pattern, ::`[tensorflow::Input](/versions/r2.14/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` rewrite, const `[RegexReplace::Attrs](/versions/r2.14/api_docs/cc/struct/tensorflow/ops/regex-replace/attrs#structtensorflow_1_1ops_1_1_regex_replace_1_1_attrs)` & attrs)` ||\n\n| ### Public attributes ||\n|-------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------|\n| [operation](#classtensorflow_1_1ops_1_1_regex_replace_1a7dda8b284f9da03cdb8789215ce49f6e) | [Operation](/versions/r2.14/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation) |\n| [output](#classtensorflow_1_1ops_1_1_regex_replace_1a5aaa612bfbbe1062fb3a7edba850dc08) | `::`[tensorflow::Output](/versions/r2.14/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n\n| ### Public functions ||\n|-------------------------------------------------------------------------------------------------------------------------|------------------------|\n| [node](#classtensorflow_1_1ops_1_1_regex_replace_1af7c8b0135952cc634c3d1eeae9d7e037)`() const ` | `::tensorflow::Node *` |\n| [operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_regex_replace_1a0278c9b0f91ce7ea1ce36d07d960c0f8)`() const ` | |\n| [operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_regex_replace_1aadbcd5dc87a024bfd055536f882464bd)`() const ` | |\n\n| ### Public static functions ||\n|---------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------|\n| [ReplaceGlobal](#classtensorflow_1_1ops_1_1_regex_replace_1a5a363e91c2910ff82c7ed8ea2454f7de)`(bool x)` | [Attrs](/versions/r2.14/api_docs/cc/struct/tensorflow/ops/regex-replace/attrs#structtensorflow_1_1ops_1_1_regex_replace_1_1_attrs) |\n\n| ### Structs ||\n|---------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [tensorflow::ops::RegexReplace::Attrs](/versions/r2.14/api_docs/cc/struct/tensorflow/ops/regex-replace/attrs) | Optional attribute setters for [RegexReplace](/versions/r2.14/api_docs/cc/class/tensorflow/ops/regex-replace#classtensorflow_1_1ops_1_1_regex_replace). |\n\nPublic attributes\n-----------------\n\n### operation\n\n```text\nOperation operation\n``` \n\n### output\n\n```text\n::tensorflow::Output output\n``` \n\nPublic functions\n----------------\n\n### RegexReplace\n\n```gdscript\n RegexReplace(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input input,\n ::tensorflow::Input pattern,\n ::tensorflow::Input rewrite\n)\n``` \n\n### RegexReplace\n\n```gdscript\n RegexReplace(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input input,\n ::tensorflow::Input pattern,\n ::tensorflow::Input rewrite,\n const RegexReplace::Attrs & attrs\n)\n``` \n\n### node\n\n```gdscript\n::tensorflow::Node * node() const \n``` \n\n### operator::tensorflow::Input\n\n```gdscript\n operator::tensorflow::Input() const \n``` \n\n### operator::tensorflow::Output\n\n```gdscript\n operator::tensorflow::Output() const \n``` \n\nPublic static functions\n-----------------------\n\n### ReplaceGlobal\n\n```text\nAttrs ReplaceGlobal(\n bool x\n)\n```"]]