Get Replaced String


We perform a bulk replacement of strings that match the pattern using regular expressions. The following steps are used to obtain the replaced string.

  1. Search for strings that match the REGEX pattern in the target string.

  2. Replace all matched substrings with the replacement string and save the result in memory as the new string.

  3. Receive the Replaced String.

Parameter

ExStrRgxRepl( "ASTER", "Klick", "Click" )

New Feature : Partial Support for Sending Control Characters

You can now include control characters in the replacement strings.

By default, CF25 does not allow the sending of control characters, but by enabling the option in ASTER, you can partially send strings that include control characters.

This allows for the detection and replacement of blank lines including newline characters using regular expressions.


Caution for Usage

Before executing the regex.replace function, be sure to send the target string to “ASTER”.

The regex.replace function requires that the target string has been pre-stored in the memory area managed by the extension through the Set TEXT command in “ASTER”.

Partial Match and Exact Match are conditions, while Replace is an expression. Only the regex.replace function requires sending the target string to “ASTER” in advance before executing the command.


REGEX Function Description
CONDITION::REGEX.Exact Match Sends the target str & search str simultaneously
CONDITION::REGEX.Partial Match Sends the target str & search str simultaneously
EXPRESSION::REGEX.Replace Sends the target str 1st, followed by the search str & replacement str

Receiving the Replaced String

The string replacement is executed on the target string, but it is not a command that directly overwrites the target string.

The replaced string is returned as a new string, so the content of the target string is not modified.


Case Sensitivity Setting

If you need to change the case sensitivity settings, enabling the option will allow you to perform case-insensitive searches.

The default setting is Off ( case-sensitive ).


Handling Control Characters

Control characters included in the replacement string are implicitly escaped by CF25.

If you want to include control characters in the replacement process or regular expressions, please enable the Control Characters setting.

The default setting is Off ( allows implicit conversion ).


About Mismatch Determination

Since it is not a search function, Mismatch Determination and the Search uID used for it cannot be used.

If there is a syntax error in the REGEX, the Regular Expression Error is available.



Frequently Asked Questions

Why does regex.replace require the target string to be sent to ASTER in advance ??

The Answer

This is a measure to avoid complexity in the expression on CF25 interface.

When using regex.replace from CF25 expressions, you need to send two values ("regex" and “keyword”).

RgxReplace( "ASTER", Edittext$( "regex" ), Edittext$( "keyword" ) )
  • Current Readability is poor, and adding a third parameter would further reduce readability, leading to input errors and bugs.

  • If data is sent in advance, one less parameter is needed.

  • Since there are no changes to the target string data, it is easy to retry if the string replacement process fails.

  • This method reduces data transfer volume compared to sending parameters each time.