Lookbehinds

Length: 00:08:50

Lesson Summary:

We know we can use lookaheads to match (or not match), but not capture, anything following our regular expression, so we can also do the same for anything that comes before. Lookbehinds allow us to craft a subexpression to be used as a boundary, either by ensuring the text comes before our captured match or by making sure it doesn't. Lookbehinds do have some limitations, however, and must be a fix-width – so no repetition can be used. We also pair our lookbehinds with a lookahead to further restrict our matches.

Get the lesson files here!:


This lesson is only available to Linux Academy members.

Sign Up To View This Lesson
Or Log In

Looking For Team Training?

Learn More