tqla Posted January 25, 2008 Share Posted January 25, 2008 I am using this to validate company names: (!ereg("^[A-Za-z'& -]{1,50}$",$_POST[$field]) I want to allow for commas and periods too. where do I add that? Thanks. Link to comment https://forums.phpfreaks.com/topic/87804-solved-quick-validation-help/ Share on other sites More sharing options...
themistral Posted January 25, 2008 Share Posted January 25, 2008 Just add them into the square brackets - but escape the period with a backslash. (!ereg("^[A-Za-z'& -\.,]{1,50}$",$_POST[$field]) Link to comment https://forums.phpfreaks.com/topic/87804-solved-quick-validation-help/#findComment-449125 Share on other sites More sharing options...
tqla Posted January 25, 2008 Author Share Posted January 25, 2008 Thank you themistral! Link to comment https://forums.phpfreaks.com/topic/87804-solved-quick-validation-help/#findComment-449163 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.