18 January 2026:


This forum is now archived and is in read-only mode. Please continue discussions on our improved new Sahi Pro Community forum.



Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.

Issue with RegEx

keatskeats Members
edited November -1 in Sahi - Open Source
The following Regex does not work.
my objective is to extract the word 'per visit'.
It works fine on any online javascript tester.
Can someone let me know the solution for this?

Script:
var $vStringToMatch = "$0 per visit";
var $vPattern = "(\d+)\s(.*)";
var $arryExp = $vPatStr.exec($vStringToMatch);
_debug($arryExp);

//Fails here, array is null
if($arryExp!=null)
{
_debug($arryExp[1]+"..."+$arryExp[2]);
}
Sign In or Register to comment.