Please enable JavaScript to view this site.

 

str = StrReplaceRegex(sFull,sFind,sReplace,bAll,bIgnoreCase)

 

This macro function takes a string sFull and replaces occurrences of the string sFind by sReplace using regular expressions.

 

•bAll: when this parameter is true, all occurrences of sFind will be replaced, otherwise only the first occurrence will be replaced.

•bIgnoreCase: when this parameter is true the search for occurrences of sFind is case insensitive.

 

Below is an example of the use of this function.

// Combine repeated day numbers, retaining the second occurrence's symbols
sResult = '22†^§ø, 22*†^'
sRegex = '([0-9]{1,2})[*†^§ø]{0,5}, \1(?=[^0-9]|$)'
sCurString = StrReplaceRegex(sResult, sRegex, '\1', true, true)
// sCurString = '22*†^'

See also: StrReplace, StrFindRegex, PadString.

 


Topic 188580, last updated on 16-Oct-2026