This is how I use it in my bash script:
current_ip=$(curl -s -X GET https://1.1.1.1/cdn-cgi/trace | grep -Po "(?<=ip=)(.*)") current_ip=$(curl -s -X GET https://1.1.1.1/cdn-cgi/trace | grep -Po "(?<=ip=)(.*)") grep -Po "(?<=ip=)(.*)"
with awk -F= '$1 == "ip" { print $2 }'