正则表达式 字符串中必须包含某个字符

^(?=.*[A-Z])(?=.*_)(?=.*d)^(?=.*[a-z]).{7,20}$

(?=.*[A-Z]) :必须包含大写字母一个

原文地址:https://www.cnblogs.com/eason-d/p/9019723.html