From WikiChip
$replacex Identifier - mIRC
< mirc‎ | identifiers(Redirected from mirc/identifiers/$replacexcs)

$replacex Performs search/replace on text strings, but doesn't replace what's already been replaced. $replacexcs is the case sensitive version.

Note $replace search each substring seperately, $replace(1234,234,z,123,u) is 1z, "234" was first checked against "1234" and then "123" isn't even checked because we reached the end of the string. But $replacex does not work like that, $replacex(1234,234,z,123,u) is u4, because the main loop is done on the input string, trying for each position to match any of the substring, so 123 is found first.


$replacex(text, substring, replace, stringN, replaceN)
$replacexcs(text , substring, replace, stringN, replaceN)


  • text - The string you want to replace from
  • substring - The 1st string you want to search for
  • replace - the replacement for the 1st string
  • substringN - The Nth string you want to search for
  • replaceN - the replacement for the Nth string

Note: Excluding the first parameter (input string), there must be an even number of substring/replace parameters





//echo -a $replacex(abc,ab,c,cc,d) vs $replace(abc,ab,c,cc,d)


Added: mIRC v6.15
Added on: 03 Jun 2004
Note: Unless otherwise stated, this was the date of original functionality.
Further enhancements may have been made in later versions.

See also[edit]