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. Quote 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]) Quote 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! Quote Link to comment https://forums.phpfreaks.com/topic/87804-solved-quick-validation-help/#findComment-449163 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.