Script that gives a sequence of numbers from text with Regex

In this example, you can search for different values in text by changing the regex variable as desired.

:arrow_down:

ar testVariable = execution.getVariable(“testVariable”);
var regex = /[1]*/gm;
var result = testVariable.match(regex);
var result2 = result;
if (result!=null)
{
var conclusion= “”;
execution.setVariable(“result”,result.toString());
}
else
{
var conclusion = “”;
}
execution.setVariable(“conclusion”,conclusion);
execution.setVariable(“testVariable”,testVariable);


  1. 0-9 ↩︎

1 Like