Replace Regular Expression
From UBot Studio
(Difference between revisions)
(Created page with "$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....") |
|||
Line 1: | Line 1: | ||
$Replace Regular Expression is a [[Text Functions|Text Function]]. | $Replace Regular Expression is a [[Text Functions|Text Function]]. | ||
− | The function returns the original text with all instances of the pattern text replaced by the replace text. | + | 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. |
− | + | ||
== Example == | == Example == |
Revision as of 01:26, 18 November 2012
$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.
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".