RegExLib.com - The first Regular Expression Library on the Web!

Please support RegExLib Sponsors

Sponsors

Expressions by User

   Displaying page 1 of 1 pages; Items 1 to 1
Title Test Details Linux Uptime Command
Expression
/^([0-2][0-9]\:[0-5][0-9]\:[0-5][0-9])\s+up\s+([0-9\:]{1,5})\s*(days|day|min|mins)?(?:\,\s+([0-9\:]{1,5})\s*(days|day|min|mins)?)?\,\s+([0-9]{1,4})\susers?\,\s+load\s+average\:\s+([0-9\.]{1,6})\,\s+([0-9\.]{1,6})\,\s+([0-9\.]{1,6})$/
Description
Take the output of the uptime command and split it into a useful array. Use array combine with the below keys array for usefull output. array('raw','time','up1','unit1','up2','unit2','users','1min','5min','15min')
Matches
13:21:33 up 219 days, 1:11, 1 user, load average: 0.00, 0.00, 0.00 | 21:17:21 up 19 days, 9:34, 1 user, load average: 0.00, 0.00, 0.00 | 21:17:21 up 19 days, 9:34, 1 user, load average: 12.30, 5.02, 1.20
Non-Matches
none
Author Rating: Not yet rated. Sam Crookes
   Displaying page 1 of 1 pages; Items 1 to 1

Copyright © 2001-2024, RegexAdvice.com | ASP.NET Tutorials