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
- Search with grep
- Rewrite text with sed
- Match in JavaScript
- Replace in JavaScript
- Find all matches in Python
- Replace in Python
All using regex in tools commands · Regular expressions pcre2 cheatsheet