コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
テンソルフロー::作戦::正規表現置換
#include <string_ops.h>
input
内のpattern
正規表現の一致を、 rewrite
で提供された置換文字列に置き換えます。
まとめ
re2 構文 ( https://github.com/google/re2/wiki/Syntax ) に従います。
引数:
- スコープ:スコープオブジェクト
- input: 処理されるテキスト。
- pattern:
input
文字列内で照合する正規表現。 - rewrite:
input
文字列内で一致するpattern
に置き換えられる書き換え文字列。
オプションの属性 ( Attrs
を参照):
- replace_global: True の場合、置換はグローバルです (つまり、各入力文字列内の
pattern
正規表現のすべての一致が書き換えられます)。それ以外の場合、 rewrite
置換は最初のpattern
一致に対してのみ行われます。
戻り値:
-
Output
: パターン一致と書き換え置換を適用した後のテキスト。
パブリック属性
公共機能
ノード
::tensorflow::Node * node() const
operator::tensorflow::Input() const
演算子::tensorflow::出力
operator::tensorflow::Output() const
パブリック静的関数
グローバルを置き換える
Attrs ReplaceGlobal(
bool x
)
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-07-26 UTC。
[null,null,["最終更新日 2025-07-26 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\nArguments:\n\n- scope: A [Scope](/versions/r1.15/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/r1.15/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/r1.15/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/r1.15/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r1.15/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` input, ::`[tensorflow::Input](/versions/r1.15/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` pattern, ::`[tensorflow::Input](/versions/r1.15/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/r1.15/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r1.15/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` input, ::`[tensorflow::Input](/versions/r1.15/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` pattern, ::`[tensorflow::Input](/versions/r1.15/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` rewrite, const `[RegexReplace::Attrs](/versions/r1.15/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/r1.15/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation) |\n| [output](#classtensorflow_1_1ops_1_1_regex_replace_1a5aaa612bfbbe1062fb3a7edba850dc08) | `::`[tensorflow::Output](/versions/r1.15/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/r1.15/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/r1.15/api_docs/cc/struct/tensorflow/ops/regex-replace/attrs) | Optional attribute setters for [RegexReplace](/versions/r1.15/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```"]]