Regular expressions pcre2 · Using regex in tools

Use lookarounds with grep

Print only the matching part, using Perl-compatible syntax with -P (GNU grep).

grep -oP '\d+(?=px)' styles.css

Official Regular expressions pcre2 documentation

More using regex in tools commands

All using regex in tools commands · Regular expressions pcre2 cheatsheet

Was this page helpful?