# Online Bash Shell.
# Code, Compile, Run and Debug Bash script online.
# Write your code in this editor and press "Run" button to execute it.
#!/bin/bash
text="{
"temp": 286.92,
"feels_like": 286.05,
"temp_min": 286.17,
"temp_max": 286.92,
"pressure": 1019,
"sea_level": 1019,
"grnd_level": 959,
"humidity": 65,
"temp_kf": 0.75
"temp": 263.92, #<--these 2 "temp" are just examples I put
"temp": 277.92, #in here so I can work better
},"
regex='((temp)...([0-9]+[.]?[0-9]+))'
#while [[ $text =~ $regex ]]; do
# echo ${BASH_REMATCH[1]}
#done
IFS=$'\n'; for line in $text; do
if [[ $line =~ $regex ]]; then
echo ${BASH_REMATCH[0]}
fi
done