Replace Regular Expression
Line 14: | Line 14: | ||
<pre>[1]...[3]</pre> | <pre>[1]...[3]</pre> | ||
+ | |||
will be looking for all numbers that start with the numbers 1 and ends with the number 3. These two numbers must have 3 other numbers between them. | will be looking for all numbers that start with the numbers 1 and ends with the number 3. These two numbers must have 3 other numbers between them. | ||
+ | |||
<pre>set(#numbers, "51234 | <pre>set(#numbers, "51234 |
Revision as of 19:50, 21 May 2013
$Replace Regular Expression is a Text Function.
The function returns the original text with all instances of the pattern text replaced by the replace text. The pattern text is the regex being used to find and replace the chosen text.
Original Text: The sentence or piece of data where the item that will be replaced is located. Accepts variables and functions such as $next list item, $list item, $random list item, $previous list item, and $table cell.
Pattern Text: The regex that will be used to find the item that will be replace.
Replace Text: The item that will replace the search text. Accepts variables and functions such as $next list item, $list item, $random list item, $previous list item, and $table cell.
Example
The regular expression:
[1]...[3]
will be looking for all numbers that start with the numbers 1 and ends with the number 3. These two numbers must have 3 other numbers between them.
set(#numbers, "51234 21324 10263", "Global") set(#numbers2, $replace regular expression(#numbers, "[1]...[3]", "REMOVED"), "Global") ui stat monitor("Resulting numbers", #numbers2)
Running the script will remove the number 10263 and replace it with the replace text "REMOVED".