Reputation: 2620
t=1814994788352,slot=35, cycle=6, nullFrameFlag=0, ppFlag=0, spyFlag=0
I have this line, and using regex i would like to extract the cycle value.
I am trying this but it doesn't work.
Match match = Regex.Match(line, @"cycle=\d,");
if (match.Success)
{
string key = match.Value;
}
Upvotes: 0
Views: 90
Reputation: 11116
@"(?<=cycle=)\d+"
use this regex. HTH
for further reference , better search for similar questions and learn regex, its helpful.
Upvotes: 3
Reputation: 9891
Have you tried capturing the value in a group:
Regex.Match(line, @"cycle=(?<cycle>\d),").Groups["cycle"].Value
Not tested the code, but something along those lines should work.
Upvotes: 1