therealwesfoster Posted March 25, 2008 Share Posted March 25, 2008 I'm wanting to allow "newline" characters in my preg_match. But how? My code preg_match("/^[\ 0-9a-zA-Z\-_]+$/",$_POST['choices']); Thanks Quote Link to comment Share on other sites More sharing options...
MadTechie Posted March 25, 2008 Share Posted March 25, 2008 preg_match("/^[\ 0-9a-zA-Z\_\n-]+$/m",$_POST['choices']); edit: added the multiline switch and moved the - to the end Quote Link to comment Share on other sites More sharing options...
therealwesfoster Posted March 25, 2008 Author Share Posted March 25, 2008 You da man madtechie I modded your code though and am using \r\n. It works just the same Wes Quote Link to comment Share on other sites More sharing options...
MadTechie Posted March 25, 2008 Share Posted March 25, 2008 as a side note have the - at the start or end otherwise it will try to create a range Quote Link to comment Share on other sites More sharing options...
therealwesfoster Posted March 25, 2008 Author Share Posted March 25, 2008 Good advice. Thanks again. (where'd the topic solved mod go?) Quote Link to comment Share on other sites More sharing options...
MadTechie Posted March 25, 2008 Share Posted March 25, 2008 Forum has been updated (i think) that mod didn't get re-added, i guess its hard to find a PHP developer nowdays .. i am not sure why it hasn't been added back Quote Link to comment 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.