جریان تنسور:: عملیات:: RegexReplace
#include <string_ops.h>
منطبقهای عبارت منظم pattern
را در input
با رشته جایگزین ارائه شده در rewrite
جایگزین میکند.
خلاصه
از نحو re2 پیروی می کند ( https://github.com/google/re2/wiki/Syntax )
استدلال ها:
- scope: یک شی Scope
- ورودی: متنی که باید پردازش شود.
- الگو: عبارت منظمی که باید در رشته های
input
مطابقت داده شود. - rewrite: رشته بازنویسی که باید جایگزین عبارت
pattern
شود که در رشته هایinput
مطابقت دارد.
ویژگی های اختیاری (به Attrs
مراجعه کنید):
- replace_global: اگر True باشد، جایگزینی جهانی است (یعنی تمام مطابقت های عبارت منظم
pattern
در هر رشته ورودی بازنویسی می شود)، در غیر این صورت جایگزینیrewrite
فقط برای اولین تطابقpattern
انجام می شود.
برمیگرداند:
-
Output
: متن پس از اعمال الگوی مطابقت و جایگزینی بازنویسی.
سازندگان و ویرانگرها | |
---|---|
RegexReplace (const :: tensorflow::Scope & scope, :: tensorflow::Input input, :: tensorflow::Input pattern, :: tensorflow::Input rewrite) | |
RegexReplace (const :: tensorflow::Scope & scope, :: tensorflow::Input input, :: tensorflow::Input pattern, :: tensorflow::Input rewrite, const RegexReplace::Attrs & attrs) |
صفات عمومی | |
---|---|
operation | |
output |
توابع عمومی | |
---|---|
node () const | ::tensorflow::Node * |
operator::tensorflow::Input () const | |
operator::tensorflow::Output () const |
توابع استاتیک عمومی | |
---|---|
ReplaceGlobal (bool x) |
سازه ها | |
---|---|
tensorflow:: ops:: RegexReplace:: Attrs | تنظیم کننده های ویژگی اختیاری برای RegexReplace . |
صفات عمومی
عملیات
Operation operation
خروجی
::tensorflow::Output output
توابع عمومی
RegexReplace
RegexReplace( const ::tensorflow::Scope & scope, ::tensorflow::Input input, ::tensorflow::Input pattern, ::tensorflow::Input rewrite )
RegexReplace
RegexReplace( const ::tensorflow::Scope & scope, ::tensorflow::Input input, ::tensorflow::Input pattern, ::tensorflow::Input rewrite, const RegexReplace::Attrs & attrs )
گره
::tensorflow::Node * node() const
عملگر::tensorflow::ورودی
operator::tensorflow::Input() const
عملگر::tensorflow::خروجی
operator::tensorflow::Output() const
توابع استاتیک عمومی
ReplaceGlobal
Attrs ReplaceGlobal( bool x )
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2025-07-26 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-07-26 بهوقت ساعت هماهنگ جهانی."],[],[],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/r2.3/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.3/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.3/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.3/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r2.3/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` input, ::`[tensorflow::Input](/versions/r2.3/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` pattern, ::`[tensorflow::Input](/versions/r2.3/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.3/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r2.3/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` input, ::`[tensorflow::Input](/versions/r2.3/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` pattern, ::`[tensorflow::Input](/versions/r2.3/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` rewrite, const `[RegexReplace::Attrs](/versions/r2.3/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.3/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation) |\n| [output](#classtensorflow_1_1ops_1_1_regex_replace_1a5aaa612bfbbe1062fb3a7edba850dc08) | `::`[tensorflow::Output](/versions/r2.3/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.3/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.3/api_docs/cc/struct/tensorflow/ops/regex-replace/attrs) | Optional attribute setters for [RegexReplace](/versions/r2.3/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```"]]