Hi,

I am looking for a feature similar to -A -B -C but not based on lines,
but based on characters or even words. Is it possible with the current
version of grep?

In the following example, I'd like to show the matched region as well
as 3 characters before and after it. But the 3 characters before and
after the match is also showed.

grep --color -o -P '.{0,3}a.{0,3}' <<< '+++++++++++++++++a++++++++++++++++++++'

-- 
Regards,
Peng



Reply via email to