How to read the particular value from Ping result
问题 I am trying to read values from below ping results, like I want to read Received value as 4 or Lost value as 0 using regular expression. Ping statistics for 74.125.200.94: Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 63ms, Maximum = 64ms, Average = 63ms I am trying with below but no go, Any help? $test = ping google.co.in $test -match "^Average = \((\d+)\)$" 回答1: Just use [regex]::Match to grab the information: $test = ping