5 lines
170 B
Bash
5 lines
170 B
Bash
if [[ $s =~ $re ]]; then
|
|
submatch=${BASH_REMATCH[0]}
|
|
modified="${s%%$submatch*}$repl${s#*$submatch}"
|
|
echo "$modified" # I am the modified string
|
|
fi
|