codes image If the question: Will the regular expression "?!:" What does that mean?
Asked
Active
Viewed 51 times
2 Answers
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.
![](../../users/profiles/8730131.webp)
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'
![](../../users/profiles/7126334.webp)
D Ie
- 800
- 5
- 23