How do I convert the following expression from POSIX to PCRE?

361 Views Asked by At

I wish there was a simple utility that would do this, as regular expressions scare me. I'd like to update the following to preg_replace() if anyone could explain to me how.

eregi_replace('([a-zA-Z0-9_]{'.$min_char.','.$max_char.'})','', $password)

Thanks for any help.

1

There are 1 best solutions below

0
On BEST ANSWER

Should be just

/([a-zA-Z0-9_]{$min_char,$max_char})/

preg_replace('/([a-zA-Z0-9_]{'.$min_char.','.$max_char.'})/','', $password)

As far as I can see only the delimiter are missing.