How do I grep in a minified file?

How do I grep in a minified file?

Aug 7, 2020

when a file has all its text on one big long line, grep is not very useful. how can i just get the part of a line I want?

Use regex to match character before and after, and -o to only show match.

grep -o “\{0,15\}search_string\{0,20\}” file