what is the difference between ?:, ?! and ?= in regex?

后端 未结 6 649
孤街浪徒
孤街浪徒 2020-11-29 14:34

I searched for the meaning of these expressions but couldn\'t understand the exact difference between them. This is what they say:

  • ?: Match expres
6条回答
  •  囚心锁ツ
    2020-11-29 15:14

    ?:  is for non capturing group
    ?=  is for positive look ahead
    ?!  is for negative look ahead
    ?<= is for positive look behind
    ?

    Please check here: http://www.regular-expressions.info/lookaround.html for very good tutorial and examples on lookahead in regular expressions.

提交回复
热议问题