$ echo "some123_string_and_another" | grep -o -P '.{0,3}string.{0,4}'
23_string_and