phppreg-matchereg

ereg() to preg_match() how?


I have kind of simple regexes that i am using.

It's so simple as:

"user/"
"user/[A-z0-9_-]"

These all work fine with ereg, but not preg.

How to convert it?

Thanks


Solution

  • It's most probably because your're missing the delimiters. Try this:

    "~user/~"
    "~user/[A-z0-9_-]~"