开发者

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

This question already has answers here: How can I convert ereg expressions to preg in PHP? (4 answers) Closed 3 years ago.

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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜