Skip to main content
April 12, 2007
Question

RegEx validation

  • April 12, 2007
  • 2 replies
  • 385 views
So far I have this regex code

/[^a-z\-\,\']|(\,.*\,)$/

which should check if a string:
contains just alpha nocase,
one or more single spaces allowed,
apostrophe, one comma, and dash allowed,
just one comma allowed

Unfortunately I cannot make it work.
Any help cordially appreciated.

contiW
This topic has been closed for replies.

2 replies

Inspiring
April 16, 2007
Hi,

Interestingly the same code is running very fine in my machine without any errors... By the way are you getting any error alerts while executing?.. Also check the "Javascript Console" of your Netscape / Firefox browsers if the page have any errors..

Inspiring
April 13, 2007
Hi,

Can you please post your code?
April 13, 2007
Simplified is like this :

var uvalue = document.getElementById("signerName").value;
var objRegExp=/[^a-z\-\,\']|(\,.*\,)$/;
alert(objRegExp.test(uvalue));