lookbehinds
Lookbehinds, or lookbehind assertions, are a feature of regular expressions that allow a pattern to assert what must come immediately before the current position without consuming any characters. They come in two main forms: positive lookbehind, written as (?<=...), and negative lookbehind, written as (?<!...). The pattern inside the lookbehind is used only to check the preceding text; the actual match is taken from the content that follows the assertion.
Lookbehinds are zero-width; they do not advance the match position. Most engines require the lookbehind pattern
Examples illustrate common uses. To match digits that follow a colon and space, you can use (?<=:\s)\d+
In practice, lookbehinds are useful for tokenization, data extraction, and validation tasks that depend on preceding