Categories

Dec 4, 2019 in JavaScript

Q: Example Of Using Regular Expressions For Syntax Checking In Javascript

1 Answer

Dec 4, 2019

var re = new RegExp("^(&[A-Za-z_0-9]{1,}=[A-Za-z_0-9]{1,})*$");

var text = myWidget.value;

var OK = re.test(text);

if( ! OK ) {

alert("The extra parameters need some work.\r\n Should be something like: \"&a=1&c=4\"");

}

Click here to read more about JavaScript
Click here to read more about Insurance

Related questions

Madanswer
Dec 4, 2019 in JavaScript
Oct 19, 2019 in JavaScript
Dec 4, 2019 in JavaScript
...