py-regex-replace/test/test_multiline_pattern2.sh

18 lines
326 B
Bash
Raw Normal View History

2023-03-20 19:54:46 +01:00
#!/usr/bin/env sh
string='alpha = a
beta = b
Exec = foo bar baz
end = EOF'
pattern='= b\nExec = .*$'
repl='= ?'
string="$(printf '%s' "${string}" | ../src/py_regex_replace/main.py -p "${pattern}" -r "${repl}" -c 1)"
printf 'RESULT>>>\n%s\n<<<RESULT\n' "${string}"
# RESULT>>>
# alpha = a
# beta = ?
# end = EOF
# <<<RESULT