I wouldn't write this in bash or any dialect of sh (for the reasons already mentioned in comments), but it seems like you're trying to extract numeric values from the output of one function and pass them two at a time to a second function?
If that's correct, you could do something like this:
re='([0-9-]+\.[0-9-]+).*Peak usage: ([0-9-]+) megabytes\.'
while read -r a b ; do
FUNCTION_B "$a" "$b"
done < <(FUNCTION_A | sed -nE "s/$re/\1 \2/p")
I'm not entirely sure that I trust that, though - it's far too easy for whatever is in $re to break the sed script. It would be better to pass $re to awk via awk's -v option or to either awk or perl as an exported environment variable.
e.g.
export re='([0-9-]+\.[0-9-]+).*Peak usage: ([0-9-]+) megabytes\.'
while read -r a b ; do
FUNCTION_B "$a" "$b"
done < <(FUNCTION_A | perl -n -e 'print "$1 $2\n" if m/$ENV{re}/')
However, I strongly recommend you put some time into learning awk and/or perl. sed and grep too.