-5

codes image If the question: Will the regular expression "?!:" What does that mean?

kai zhou
  • 3
  • 2

2 Answers2

0

This is a "Negative Lookahead Assertion". This code is saying "this regular expression matches only if it begins with /wiki/ and is not followed by a colon".

Consider reading through https://www.regular-expressions.info and in particular the Lookahead and Lookbehind Zero-Length Assertions.

hunteke
  • 3,309
  • 1
  • 4
  • 15
-2
? --> zero or one occurrences of the previous expression
! --> negation
: --> simple colon

So... it would mean 'zero or one occurrences of the previous expression, not followed by a colon'

D Ie
  • 800
  • 5
  • 23