What does ?= mean in a regular expression?

前端 未结 4 1368
一向
一向 2020-11-29 20:21

May I know what ?= means in a regular expression? For example, what is its significance in this expression:

(?=.*\\d).
4条回答
  •  旧时难觅i
    2020-11-29 21:08

    (?=pattern) is a zero-width positive lookahead assertion. For example, /\w+(?=\t)/ matches a word followed by a tab, without including the tab in $&.

提交回复
热议问题