Regular Expressions 101

Community Patterns

Estract download speed from Ookla Speedtest output

1

Regular Expression
PCRE2 (PHP >=7.3)

/
^.*Download:\s{3,5}\K\d{1,3}\.\d{0,2}(?= Mbps)
/
gm

Description

surely can be optimized more, but it does the job and the interested number of lines is fairly low.

Submitted by anonymous - 2 months ago