Regular Expressions: Is there an AND operator?

后端 未结 12 2010
刺人心
刺人心 2020-11-21 06:34

Obviously, you can use the | (pipe?) to represent OR, but is there a way to represent AND as well?

Specifically, I\'d like to

12条回答
  •  暗喜
    暗喜 (楼主)
    2020-11-21 07:05

    If you use Perl regular expressions, you can use positive lookahead:

    For example

    (?=[1-9][0-9]{2})[0-9]*[05]\b
    

    would be numbers greater than 100 and divisible by 5

提交回复
热议问题