#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "air_temp": ([\d.]+)"
Local $sString = " {" & @CRLF & _
" "observations": {" & @CRLF & _
" "notice": [" & @CRLF & _
" {" & @CRLF & _
" "copyright": "Copyright Commonwealth of Australia 2017, Bureau of Meteorology. For more information see: http://www.bom.gov.au/other/copyright.shtml http://www.bom.gov.au/other/disclaimer.shtml"," & @CRLF & _
" "copyright_url": "http://www.bom.gov.au/other/copyright.shtml"," & @CRLF & _
" "disclaimer_url": "http://www.bom.gov.au/other/disclaimer.shtml"," & @CRLF & _
" "feedback_url": "http://www.bom.gov.au/other/feedback"" & @CRLF & _
" }" & @CRLF & _
" ]," & @CRLF & _
" "header": [" & @CRLF & _
" {" & @CRLF & _
" "refresh_message": "Issued at 12:11 pm EST Tuesday 11 July 2017"," & @CRLF & _
" "ID": "IDN60901"," & @CRLF & _
" "main_ID": "IDN60902"," & @CRLF & _
" "name": "Canberra"," & @CRLF & _
" "state_time_zone": "NSW"," & @CRLF & _
" "time_zone": "EST"," & @CRLF & _
" "product_name": "Capital City Observations"," & @CRLF & _
" "state": "Aust Capital Territory"" & @CRLF & _
" }" & @CRLF & _
" ]," & @CRLF & _
" "data": [" & @CRLF & _
" {" & @CRLF & _
" "sort_order": 0," & @CRLF & _
" "wmo": 94926," & @CRLF & _
" "name": "Canberra"," & @CRLF & _
" "history_product": "IDN60903"," & @CRLF & _
" "local_date_time": "11/12:00pm"," & @CRLF & _
" "local_date_time_full": "20170711120000"," & @CRLF & _
" "aifstime_utc": "20170711020000"," & @CRLF & _
" "lat": -35.3," & @CRLF & _
" "lon": 149.2," & @CRLF & _
" "apparent_t": 5.7," & @CRLF & _
" "cloud": "Mostly clear"," & @CRLF & _
" "cloud_base_m": 1050," & @CRLF & _
" "cloud_oktas": 1," & @CRLF & _
" "cloud_type_id": 8," & @CRLF & _
" "cloud_type": "Cumulus"," & @CRLF & _
" "delta_t": 3.6," & @CRLF & _
" "gust_kmh": 11," & @CRLF & _
" "gust_kt": 6," & @CRLF & _
" "air_temp": 9.0," & @CRLF & _
" "dewpt": 0.2," & @CRLF & _
" "press": 1032.7," & @CRLF & _
" "press_qnh": 1031.3," & @CRLF & _
" "press_msl": 1032.7," & @CRLF & _
" "press_tend": "-"," & @CRLF & _
" "rain_trace": "0.0"," & @CRLF & _
" "rel_hum": 54," & @CRLF & _
" "sea_state": "-"," & @CRLF & _
" "swell_dir_worded": "-"," & @CRLF & _
" "swell_height": null," & @CRLF & _
" "swell_period": null," & @CRLF & _
" "vis_km": "10"," & @CRLF & _
" "weather": "-"," & @CRLF & _
" "wind_dir": "WNW"," & @CRLF & _
" "wind_spd_kmh": 7," & @CRLF & _
" "wind_spd_kt": 4" & @CRLF & _
" }," & @CRLF & _
" {" & @CRLF & _
" "sort_order": 1," & @CRLF & _
" "wmo": 94926," & @CRLF & _
" "name": "Canberra"," & @CRLF & _
" "history_product": "IDN60903"," & @CRLF & _
" "local_date_time": "11/11:30am"," & @CRLF & _
" "local_date_time_full": "20170711113000"," & @CRLF & _
" "aifstime_utc": "20170711013000"," & @CRLF & _
" "lat": -35.3," & @CRLF & _
" "lon": 149.2," & @CRLF & _
" "apparent_t": 4.6," & @CRLF & _
" "cloud": "Mostly clear"," & @CRLF & _
" "cloud_base_m": 900," & @CRLF & _
" "cloud_oktas": 1," & @CRLF & _
" "cloud_type_id": 8," & @CRLF & _
" "cloud_type": "Cumulus"," & @CRLF & _
" "delta_t": 2.9," & @CRLF & _
" "gust_kmh": 9," & @CRLF & _
" "gust_kt": 5," & @CRLF & _
" "air_temp": 7.3," & @CRLF & _
" "dewpt": 0.1," & @CRLF & _
" "press": 1033.1," & @CRLF & _
" "press_qnh": 1031.7," & @CRLF & _
" "press_msl": 1033.1," & @CRLF & _
" "press_tend": "-"," & @CRLF & _
" "rain_trace": "0.0"," & @CRLF & _
" "rel_hum": 60," & @CRLF & _
" "sea_state": "-"," & @CRLF & _
" "swell_dir_worded": "-"," & @CRLF & _
" "swell_height": null," & @CRLF & _
" "swell_period": null," & @CRLF & _
" "vis_km": "10"," & @CRLF & _
" "weather": "-"," & @CRLF & _
" "wind_dir": "NW"," & @CRLF & _
" "wind_spd_kmh": 4," & @CRLF & _
" "wind_spd_kt": 2" & @CRLF & _
" }" & @CRLF & _
" ]" & @CRLF & _
" }" & @CRLF & _
"}"
Local $aArray = StringRegExp($sString, $sRegex, $STR_REGEXPARRAYFULLMATCH)
; Present the entire match result
_ArrayDisplay($aArray, "Result")
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for AutoIt, please visit: https://www.autoitscript.com/autoit3/docs/functions/StringRegExp.htm