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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find 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
Source
Your Rating
Bad Good

Enter New Comment

Title
 
Name
 
Comment
 
Spammers suck - we apologize. Please enter the text shown below to enable your comment (not case sensitive - try as many times as you need to if the first ones are too hard):

Existing User Comments

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