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)){...} 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 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: /.+\/.+/ Link to comment https://forums.phpfreaks.com/topic/267130-preg_math-help/#findComment-1369666 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.