$ echo "some123_string_and_another" | grep -o -P '.{0,3}string.{0,4}'
23_string_and
Linux shell——grep命令输出匹配字符串的前后n个字符
最新推荐文章于 2024-05-01 15:13:50 发布
$ echo "some123_string_and_another" | grep -o -P '.{0,3}string.{0,4}'
23_string_and