Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server (Not)   Client   Old   Guides   Examples
New in version: 6.3   6.4   6.5   7.0   7.1   7.2   7.3   7.4   7.5   8.0    Statistic  


Replaces patterns.

Component Version macOS Windows Server FileMaker Cloud FileMaker iOS SDK
RegEx 7.5 Yes Yes Yes Yes Yes

MBS( "RegEx.ReplaceAll"; Text; Pattern; Rewrite { ; Options } )


Parameter Description Example value
Text The text to use. "hello world"
Pattern The pattern to use. "l+"
Rewrite The output pattern. "\1\1"
Options Optional
The PCRE options.
Can be given as text or number.


Returns new text or error.


Replaces patterns.
You can replace the all occurrences of pattern in text with rewrite pattern. Within rewrite pattern, backslash-escaped digits (\1 to \9) can be used to insert text matching corresponding parenthesized group from the pattern. \0 in rewrite refers to the entire matching text.

Replacements are not subject to re-matching.


Replace all:

MBS( "RegEx.ReplaceAll"; "yabba dabba doo"; "b+"; "d" )

Example result: "yadda dadda doo"

Replace all greedy:

MBS( "RegEx.ReplaceAll"; "yabba dabba doo"; "b+"; "d"; "greedy" )

Example result: "yada dada doo"

See also

RegEx.Replace   -   RegEx.Results

Feedback: Report problem or ask question.

MBS Xojo Chart Plugins