Stig Christian
Stig Christian

Reputation: 287

Extracting information with simple Regex expression

I have this string: OK (0 msec) and need to extract the following using Regex:

All parts may vary, but it will always be TEXT (DECIMAL TEXT)

And, it HAS to be done with Regex

Upvotes: 0

Views: 43

Answers (1)

burning_LEGION
burning_LEGION

Reputation: 13450

use this regex ([a-zA-Z]+)\s\((\d+)\s([a-zA-Z]+)\)

OK in group1

0 in group 2

msec in group 3

Upvotes: 1

Related Questions