You are here: Strings > stringreplacer.

stringreplacer.

替换匹配字符串或源属性中包含的字符串中的正则表达式的子字符串。

Parameters

例子

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.

编辑变换器参数

使用一组菜单选项,可以通过引用工作区中的其他元素来分配变压器参数。一些变压器也可提供更高级的功能,例如高级编辑器和算术编辑器。要访问这些选项的菜单,请单击除适用的参数旁边。有关更多信息,请参阅变换器参数菜单选项.

变压器类别

Strings

搜索FME知识中心

搜索有关此变压器的样本和信息FME Knowledge Center.