This is actually one where grep with -E extended regex matching can help, e.g.
grep -E -o 'var[0-9]*[[:blank:]]*=[[:blank:]]*[^,[:blank:]]+' <<< $str
Results in:
var1=test
var2=testing
var3=testing1
The [[:blank:]]* on either side of the '=' just allows for spaces on either side, if present. If there is never a chance of that, you can shorten it to grep -E -o 'var[0-9]*=[^,[:blank:]]+'.
Edit Per-Comment
To store it in var1, simply:
var1=$(grep -E -o 'var[0-9]*[[:blank:]]*=[[:blank:]]*[^,[:blank:]]+' <<< $str)
(or better, store each combination in an array, or create an associative array from the variable names and values themselves) For example, to store all of the var=val combinations in an associative array you could do:
str="the value of var1=test, the value of var2=testing, the final value of var3=testing1"
declare -A array
while read -r line; do
array[${line%=*}]=${line#*=}
done < <(grep -E -o 'var[0-9]*[[:blank:]]*=[[:blank:]]*[^,[:blank:]]+' <<< $str)
for i in ${!array[@]}; do
echo "$i => ${array[$i]}"
done
Example Output
var1 => test
var3 => testing1
var2 => testing
str1=.