Alex Rivera | Logout

What does ?= mean in a regular expression?

Asked 2009-10-15T07:55:01.450
111

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

(?=.*\d).
Edit
Report

1 Answer

17

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

answered 2009-10-15T07:57:35.010

Your Answer