I need an expression that matches a-z and the underscore only. Everything else is rejected.
Example: I have a string that looks like this "gallery/[gallery_name]". I want to match "gallery_name". I've tried preg_match('/gallery\/[a-z_]/i', $p), but it doesn't seem to work.
I want all of these to return true, anything other than a-z and the underscore to return falase.
gallery/numberone
gallery/number_one
gallery/number_one_a
gallery/number_one_a_b
I hope I made sense to someone!
As always, thanks for you help!