Link to home
Start Free TrialLog in
Avatar of ltpitt
ltpitt

asked on

Extract data from output with RegEx

Hi there!

I have this output:
200
real    0m0.282s
user    0m0.002s
sys     0m0.005s

I'd need to extract the 1st number (in this case 200) and the value close to real.

My final result would be:
200 for the 1st extraction

0m0.282s for the 2nd extraction

I tried:
real\s+(.*)

and:
/^(.*)$/m

But it doesn't work...

What am I doing wrong?

I'd just need a RegEx suggestion, not for any specific programming language.
ASKER CERTIFIED SOLUTION
Avatar of Rgonzo1971
Rgonzo1971

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial