bookmarks/cheat/regex.md

7 lines
245 B
Markdown
Raw Normal View History

2020-02-12 21:30:25 +00:00
### Print only the captured group ([src](https://unix.stackexchange.com/a/13472/220566))
Example with expression `key=value toast=pain hello=bonjour`
if you want to capture only what comes after `key=`, you can use :
`grep -oP 'key=\K\w+'`