#include <MsgBoxConstants.au3> ; to declare the Constants of MsgBox
Local $sRegex = "(?m)^.*Download:\s{3,5}\K\d{1,3}\.\d{0,2}(?= Mbps)"
Local $sString = " Speedtest by Ookla" & @CRLF & _
"" & @CRLF & _
" Server: Fastweb SpA - Milan (id: 7839)" & @CRLF & _
" ISP: Wind Tre" & @CRLF & _
"Idle Latency: 29.13 ms (jitter: 7.59ms, low: 22.73ms, high: 33.85ms)" & @CRLF & _
" Download: 238.14 Mbps (data used: 384.0 MB)" & @CRLF & _
" 603.92 ms (jitter: 87.34ms, low: 37.24ms, high: 1203.74ms)" & @CRLF & _
" Upload: 46.48 Mbps (data used: 43.4 MB)" & @CRLF & _
" 172.46 ms (jitter: 54.67ms, low: 37.41ms, high: 304.20ms)" & @CRLF & _
" Packet Loss: 0.0%" & @CRLF & _
" Result URL: https://www.speedtest.net/result/c/f4f1d464-82c6-4980-8b3f-38358ccedbfb" & @CRLF & _
"" & @CRLF & _
" Speedtest by Ookla" & @CRLF & _
"" & @CRLF & _
" Server: Fastweb SpA - Milan (id: 7839)" & @CRLF & _
" ISP: Wind Tre" & @CRLF & _
"Idle Latency: 23.63 ms (jitter: 0.51ms, low: 23.25ms, high: 25.28ms)" & @CRLF & _
" Download: 209.23 Mbps (data used: 356.9 MB)" & @CRLF & _
" 629.97 ms (jitter: 87.98ms, low: 34.60ms, high: 966.30ms)" & @CRLF & _
" Upload: 44.29 Mbps (data used: 39.4 MB)" & @CRLF & _
" 179.07 ms (jitter: 54.45ms, low: 55.78ms, high: 288.01ms)" & @CRLF & _
" Packet Loss: 0.0%" & @CRLF & _
" Result URL: https://www.speedtest.net/result/c/ab0ea00c-28c1-4ab0-a65e-3e49ec70160f" & @CRLF & _
"" & @CRLF & _
" Speedtest by Ookla" & @CRLF & _
"" & @CRLF & _
" Server: Fastweb SpA - Milan (id: 7839)" & @CRLF & _
" ISP: Wind Tre" & @CRLF & _
"Idle Latency: 23.36 ms (jitter: 5.38ms, low: 22.38ms, high: 32.22ms)" & @CRLF & _
" Download: 190.75 Mbps (data used: 341.4 MB)" & @CRLF & _
" 811.89 ms (jitter: 81.96ms, low: 38.70ms, high: 1557.16ms)" & @CRLF & _
" Upload: 46.68 Mbps (data used: 78.4 MB)" & @CRLF & _
" 177.39 ms (jitter: 57.87ms, low: 54.85ms, high: 636.20ms)" & @CRLF & _
" Packet Loss: 0.0%" & @CRLF & _
" Result URL: https://www.speedtest.net/result/c/6618ad7c-8990-4e8c-9ccf-b2d8726e5757" & @CRLF & _
"" & @CRLF & _
" Speedtest by Ookla" & @CRLF & _
"" & @CRLF & _
" Server: Fastweb SpA - Milan (id: 7839)" & @CRLF & _
" ISP: Wind Tre" & @CRLF & _
"Idle Latency: 23.37 ms (jitter: 0.97ms, low: 22.43ms, high: 24.39ms)" & @CRLF & _
" Download: 7.30 Mbps (data used: 9.5 MB)" & @CRLF & _
" 788.00 ms (jitter: 148.57ms, low: 195.04ms, high: 2617.58ms)" & @CRLF & _
" Download: FAILED" & @CRLF & _
"" & @CRLF & _
" Speedtest by Ookla" & @CRLF & _
"" & @CRLF & _
" Server: Fastweb SpA - Milan (id: 7839)" & @CRLF & _
" ISP: Wind Tre" & @CRLF & _
"Idle Latency: 24.34 ms (jitter: 5.23ms, low: 23.35ms, high: 32.27ms)" & @CRLF & _
" Download: 29.70 Mbps (data used: 36.9 MB)" & @CRLF & _
" 2842.76 ms (jitter: 102.51ms, low: 36.73ms, high: 3780.32ms)" & @CRLF & _
" Upload: 7.91 Mbps (data used: 11.4 MB)" & @CRLF & _
" 642.92 ms (jitter: 85.25ms, low: 168.67ms, high: 1465.30ms)" & @CRLF & _
" Packet Loss: 0.0%" & @CRLF & _
" Result URL: https://www.speedtest.net/result/c/c625078c-1efb-4d0c-86f6-47f85ee1838e" & @CRLF & _
"" & @CRLF & _
" Speedtest by Ookla" & @CRLF & _
"" & @CRLF & _
" Server: Fastweb SpA - Milan (id: 7839)" & @CRLF & _
" ISP: Wind Tre" & @CRLF & _
"Idle Latency: 23.40 ms (jitter: 0.75ms, low: 22.38ms, high: 24.37ms)" & @CRLF & _
" Download: 48.79 Mbps (data used: 53.9 MB)" & @CRLF & _
" 1605.18 ms (jitter: 98.93ms, low: 51.83ms, high: 2609.00ms)" & @CRLF & _
" Upload: 10.45 Mbps (data used: 5.4 MB)" & @CRLF & _
" 350.75 ms (jitter: 80.15ms, low: 60.41ms, high: 742.65ms)" & @CRLF & _
" Packet Loss: 0.0%" & @CRLF & _
" Result URL: https://www.speedtest.net/result/c/594b8f34-673c-4670-a091-56104e909153" & @CRLF & _
"" & @CRLF & _
" Speedtest by Ookla" & @CRLF & _
"" & @CRLF & _
" Server: Fastweb SpA - Milan (id: 7839)" & @CRLF & _
" ISP: Wind Tre" & @CRLF & _
"Idle Latency: 24.63 ms (jitter: 4.15ms, low: 24.34ms, high: 32.18ms)" & @CRLF & _
" Download: 58.12 Mbps (data used: 69.5 MB)" & @CRLF & _
" 1889.25 ms (jitter: 101.87ms, low: 96.60ms, high: 3067.85ms)" & @CRLF & _
" Upload: 10.45 Mbps (data used: 18.9 MB)" & @CRLF & _
" 591.63 ms (jitter: 88.04ms, low: 79.24ms, high: 1231.14ms)" & @CRLF & _
" Packet Loss: 0.0%" & @CRLF & _
" Result URL: https://www.speedtest.net/result/c/35fd9653-3907-4ddd-8680-8ca69b2f0de7" & @CRLF & _
"" & @CRLF & _
" Speedtest by Ookla" & @CRLF & _
"" & @CRLF & _
" Server: Fastweb SpA - Milan (id: 7839)" & @CRLF & _
" ISP: Wind Tre" & @CRLF & _
"Idle Latency: 22.87 ms (jitter: 1.21ms, low: 22.35ms, high: 23.94ms)" & @CRLF & _
" Download: 65.27 Mbps (data used: 76.1 MB)" & @CRLF & _
" 1603.47 ms (jitter: 97.63ms, low: 48.89ms, high: 2508.82ms)" & @CRLF & _
" Upload: 10.92 Mbps (data used: 8.3 MB)" & @CRLF & _
" 403.47 ms (jitter: 83.73ms, low: 77.31ms, high: 814.42ms)" & @CRLF & _
" Packet Loss: 0.0%" & @CRLF & _
" Result URL: https://www.speedtest.net/result/c/8de80c8e-cf49-43ee-8964-133e25c7e783" & @CRLF & _
"" & @CRLF & _
" Speedtest by Ookla" & @CRLF & _
"" & @CRLF & _
" Server: Fastweb SpA - Milan (id: 7839)" & @CRLF & _
" ISP: Wind Tre" & @CRLF & _
"Idle Latency: 24.64 ms (jitter: 1.16ms, low: 22.85ms, high: 25.41ms)" & @CRLF & _
" Download: 66.83 Mbps (data used: 77.7 MB)" & @CRLF & _
""
Local $sSubst = ""
Local $sResult = StringRegExpReplace($sString, $sRegex, $sSubst)
MsgBox($MB_SYSTEMMODAL, "Result", $sResult)
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