commit
354c633803
2 changed files with 2 additions and 2 deletions
|
@ -1,7 +1,7 @@
|
|||
|
||||
The regexp for an integer number is `pattern:\d+`.
|
||||
|
||||
We can exclude negatives by prepending it with the negative lookahead: `pattern:(?<!-)\d+`.
|
||||
We can exclude negatives by prepending it with the negative lookbehind: `pattern:(?<!-)\d+`.
|
||||
|
||||
Although, if we try it now, we may notice one more "extra" result:
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Lookahead and lookbehind
|
||||
|
||||
Sometimes we need to find only those matches for a pattern that are followed or preceeded by another pattern.
|
||||
Sometimes we need to find only those matches for a pattern that are followed or preceded by another pattern.
|
||||
|
||||
There's a special syntax for that, called "lookahead" and "lookbehind", together referred to as "lookaround".
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue