stringreplacer.
Parameters
![关闭](http://www.baooytra.com/docs/fme/2017.0/html/FME_Desktop_Documentation/FME_Transformers/Skins/Default/Stylesheets/Images/transparent.gif)
This parameter specifies which attributes will have substrings replaced.
![关闭](http://www.baooytra.com/docs/fme/2017.0/html/FME_Desktop_Documentation/FME_Transformers/Skins/Default/Stylesheets/Images/transparent.gif)
此参数指定将替换的子字符串。(也看到了替换文本和将属性值设置为parameters.)
![关闭](http://www.baooytra.com/docs/fme/2017.0/html/FME_Desktop_Documentation/FME_Transformers/Skins/Default/Stylesheets/Images/transparent.gif)
替换文本参数指定将替换替换子字符串的实例的子字符串。
If the replacement text contains&或者0., then it is replaced in the substitution with the portion of string that matched the regular expression.
如果替换文本包含\, 在哪里#是1到9之间的数字,然后在替换符合正则表达式的第n个括号子表达式的字符串的替换中替换它。
特殊字符序列可以在两者中使用Text to Match和替换文本parameters.
字符可以表示为常规字符,但它们还可以包含任何数量的控制字符。
Special character sequences (Advanced Editor only) are interpreted as shown below:
顺序 | 描述 |
---|---|
Ctrl+Shift+h (^H) |
Backspace(0x08) |
Ctrl + Shift + L(^ l) |
形式饲料(0x0c) |
Ctrl + Shift + J(^ J) |
纽诺(0x0A) |
Ctrl + Shift + R(^ M) |
回车返回(0x0d) |
Ctrl+Shift+i (^I) |
标签(0x09) |
Ctrl + Shift + K(^ K) |
垂直标签(0x0b) |
定义特殊字符
您可以通过基本或高级编辑器定义特殊字符。单击“参数”菜单中的“打开编辑器”:
Basic Text Editor
选择持续的from the String Type column (or, in some transformers, the Value column) and click on the empty field in the column:
单击列右侧的“浏览”按钮以打开“编辑值”对话框。在此编辑器中,使用上面的表中使用快捷键输入字符。
高级文本编辑器
使用上表中的快捷方式输入字符。
笔记:要查看Tab字符,请单击左下角的选项菜单,然后选择显示空间/选项卡.
![关闭](http://www.baooytra.com/docs/fme/2017.0/html/FME_Desktop_Documentation/FME_Transformers/Skins/Default/Stylesheets/Images/transparent.gif)
This parameter specifies whether theText to Match参数是纯字符串或正则表达式。
如果参数设置为是的,支持高级正则表达式(ARES)。A是一个或多个分支,由“|”分开,匹配与任何分支匹配的任何东西。
如果参数设置为是的, the Regex Editor will be available in the parameter menu.
此表列出了特殊字符:
特殊字符 | 描述 |
---|---|
| | separates "branches" (or choices) |
* | 在它之前的0或更多匹配序列 |
+ | 一系列的一个或多个比赛的序列 |
? | 在它之前的0或1场比赛的序列 |
. | 匹配任何单个字符 |
^ | 匹配值的开始 |
$ | matches the end of the value |
[] | 括起一组角色选择 |
() | 括起“子表达式” - 将每个子表达式匹配的任何匹配放入_matched_parts {}列表属性中 |
a | 任何字符都可以列出匹配 |
![关闭](http://www.baooytra.com/docs/fme/2017.0/html/FME_Desktop_Documentation/FME_Transformers/Skins/Default/Stylesheets/Images/transparent.gif)
- 是:变形金刚将执行区分敏感的子字符串匹配。
- No: The transformer will perform case-insensitive substring matching.
![关闭](http://www.baooytra.com/docs/fme/2017.0/html/FME_Desktop_Documentation/FME_Transformers/Skins/Default/Stylesheets/Images/transparent.gif)
If theText To Matchparameter is not found, the attribute value will be set to the value specified by this parameter. For more information about options for setting this parameter, see变换器参数菜单选项.
例子
In this example, a pure substitution of text is made without any use of regular expression functionality. This is the simplest kind of substring replacement.
源字符串:bobby
要查找的文字:obb
替换文字:生病
使用正则表达式:否
区分大小写: yes
结果:比利
In this example, a pattern matching zero or more ’b’ characters is replaced with nothing.
源字符串:bobby
Text to Find: b*
替换文本:
Use Regular Expression: yes
区分大小写: yes
结果:男孩
在该示例中,结果(用连字符)重复匹配零或更多'B'字符后跟y的模式)
源字符串:bobby
要查找的文字:b * y
替换文本: - \\ 0 - \\ 0
Use Regular Expression: yes
区分大小写: yes
结果:博 - Bby-Bby
相关变压器
看看stringsearcher.变压器帮助其他正则表达式示例。
To replace pairs of substrings, use theStringpairreplacer.变压器。
To search for regular expression matches in a string without doing any replacement, use thestringsearcher.变压器。
额外资源
Test regular expressions with the Regex Editor in the parameter menu.
编辑变换器参数
使用一组菜单选项,可以通过引用工作区中的其他元素来分配变压器参数。一些变压器也可提供更高级的功能,例如高级编辑器和算术编辑器。要访问这些选项的菜单,请单击除适用的参数旁边。有关更多信息,请参阅变换器参数菜单选项.
变压器类别
搜索FME知识中心
搜索有关此变压器的样本和信息FME Knowledge Center.