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.

Regular expression

vinilnarayanvinilnarayan Members
edited January 2014 in Sahi - Open Source
hi..
I have an application with a field, that should accept only 11 digits. but if it is a 11 digit value, it should contain 3 decimal part. Eg 12345678.123... and other matches are ( 12345678, 123.1, 1.12, 12.123, 123344.12 etc)(ie, an..11,3...

I need the corresponding java script to check this regular expression.

Answers

  • this is not working...

    main();

    function main()
    {
    var $arr=;
    var $reg='^[0-9]{3}';
    for( var $i=0; $i<$arr.length; $i++)
    {
    var $f= $arr[$i].match($reg);

    if (_condition($f == true))
    {
    _debug($arr[$i] + ": Matched");
    }
    else
    {
    _debug($arr[$i] + ": Not Matched");
    }
    }
    }
Sign In or Register to comment.