GD77 Posted August 15, 2012 Share Posted August 15, 2012 hello: I need to allow this char. in the preg_match "/": if(!preg_match('/^[a-z0-9_\/a\-]+$/i',$var)){...} Quote Link to comment https://forums.phpfreaks.com/topic/267130-preg_math-help/ Share on other sites More sharing options...
GD77 Posted August 15, 2012 Author Share Posted August 15, 2012 can t I delete my post? admin or moderator plz delete it solved it thx Quote Link to comment https://forums.phpfreaks.com/topic/267130-preg_math-help/#findComment-1369648 Share on other sites More sharing options...
ManiacDan Posted August 15, 2012 Share Posted August 15, 2012 Post the solution so that others may benefit. Also, mark it as "solved." The answer, for anyone who comes across this, is: 1) Use alternate delimiters. Regular expressions don't have to start and end with /. You can use any non-alphanum character, like # or even {}. 2) Escape the slash, like so: /.+\/.+/ Quote Link to comment https://forums.phpfreaks.com/topic/267130-preg_math-help/#findComment-1369666 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.