简体   繁体   English

正则表达式不是以两个“WW”或“MM”开头

[英]Regular Expression not start with two 'WW' or 'MM'

1). 1)。 modification require below expression修改需要以下表达式

^.{0,100}$ this expression not begin with 'WW' or'MM' and not add spacial characters ^.{0,100}$此表达式不以“WW”或“MM”开头且不添加空格字符

other condition is其他条件是

2). 2)。 how can i add ^.{0,100}$ this condition in below expression我如何在下面的表达式中添加^.{0,100}$这个条件

(?:WW[A-Za-z0-9]{10}|MM\d{8})$

For the first pattern, use a negative lookahead对于第一个模式,使用负前瞻

^(?!WW|MM)[A-Za-z0-9]{0,100}$

For the second pattern, fill the rest for either part with any char until 100对于第二个模式,用任何字符填充任一部分的其余部分,直到 100

^(?:WW[A-Za-z0-9]{10}.{88}|MM\d{8}.{90})$

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM