mirror of
https://github.com/ziishaned/learn-regex.git
synced 2025-08-06 03:26:42 -04:00
parent
0c3228afab
commit
8c1912d000
@ -421,7 +421,7 @@ or `the` which are followed by the word `fat`.
|
|||||||
### 4.2 Negative Lookahead
|
### 4.2 Negative Lookahead
|
||||||
|
|
||||||
Negative lookahead is used when we need to get all matches from input string
|
Negative lookahead is used when we need to get all matches from input string
|
||||||
that are not followed by a pattern. Negative lookahead defined same as we define
|
that are not followed by a pattern. Negative lookahead is defined same as we define
|
||||||
positive lookahead but the only difference is instead of equal `=` character we
|
positive lookahead but the only difference is instead of equal `=` character we
|
||||||
use negation `!` character i.e. `(?!...)`. Let's take a look at the following
|
use negation `!` character i.e. `(?!...)`. Let's take a look at the following
|
||||||
regular expression `(T|t)he(?!\sfat)` which means: get all `The` or `the` words
|
regular expression `(T|t)he(?!\sfat)` which means: get all `The` or `the` words
|
||||||
|
Loading…
x
Reference in New Issue
Block a user