|
|
|
|
|
<ANSI string>.RegexReplace (Function) In french: <Chaîne ANSI>.RegexRemplace Replaces all the parts of a string that match a specific format. New in version 2025
sString is string
sString = "The order will be delivered between 28/08/2020 and 02/09/2020."
sString = sString.RegexReplace("([0-9]{1,2})/([0-9]{1,2})/([0-9]{4})", "$2/$1/$3")
s is string = "aaa" + Charact(10) + "bbb" + Charact(13) + Charact(10) + ...
"ccc" + Charact(13) + Charact(10) + "ddd" + Charact(10) + "eee" + Charact(13) + "fff"
Trace(s)
s2 is string = s.RegexReplace("(.*)([^\n])\r(.*)", "$1$2" + Charact(13) + Charact(10) + "$3")
Trace(s2)
Syntax
<Result> = <Initial string>.RegexReplace(<Format> , <Replacement string>)
<Result>: Character string String in which the replacements were made. <Initial string>: ANSI string variable String in which the replacements are to be made. <Format>: Character string Regular expression that indicates the format of the part of the string to be replaced. <Replacement string>: Character string String that will replace all the parts of the initial string that match the given format. Remarks - The specification used for regular expressions is ECMAScript.
- You can retrieve a part of a string to use it in the replacement string (see example). In this case:
- '$&' corresponds to the whole found string.
- '$1' corresponds to the first part of the found string.
- '$2' corresponds to the second part of the found string.
- '$n' corresponds to the nth part of the found string.
Business / UI classification: Neutral code
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|