jasonc Posted December 19, 2007 Share Posted December 19, 2007 i have the following that allows letters but i need it to also allow numbers and underscores and i can not work out what needs changing to get this to work. !eregi("^[[:alpha:][:space:]]{3,30}$", $username ) i tried this... !eregi("^[[:alpha:][:space:][0-9]]{3,30}$", $username ) to allow numbers but it did not work. thanks in advance for your help. Link to comment https://forums.phpfreaks.com/topic/82389-allow-a-z-a-z-0-9-and-underscore-in-a-variable-used-for-username-sign-up/ Share on other sites More sharing options...
Orio Posted December 19, 2007 Share Posted December 19, 2007 eregi("^[a-z0-9_]+$", $str); Orio Link to comment https://forums.phpfreaks.com/topic/82389-allow-a-z-a-z-0-9-and-underscore-in-a-variable-used-for-username-sign-up/#findComment-418838 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.