barkster Posted July 28, 2007 Share Posted July 28, 2007 I'm trying to do a regex to allow only alphanumeric and the underscore but I can't get it to work. I've tested on a few reg testers and it worked there but I can't get it to work on my page. javascript var rah = new RegExp(/([^A-Za-z0-9_])/); if (!rah.test(f.tbgalleryname.value)) { alert("Your folder name has illegal characters.\nCan only contain alphanumeric characters (a-z 0-9 _)"); return false; } Link to comment https://forums.phpfreaks.com/topic/62193-regular-expression-alphanumeric-underscore/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.