B
Ben Dewey
Hey,
I have only been playing with regular expressions for some time. I am
working on some code that parses and object 560 event log. I have created
two expressions the first one which works okay is for the actual csv of each
log. The second one parses out the description of the log. My problem is
with the accesses section of the description.
How do I parse multiple groups that have the same name. When I do a for
each through the groups I get the first value for each.
Snippet:
-----------------------------------------------
expression:
Accesses:\t(?
?<accesses>.+)\s+)+?^(?: \t)
log section:
Accesses: READ_CONTROL
SYNCHRONIZE
ReadData (or ListDirectory)
ReadEA
ReadAttributes
Privileges: -
I would like to do something like
Match m = Regex.Match(log, expression);
foreach(string access in m.Groups["accesses"])
{
//write that access
}
Is this possible?
PS. I am using "The Regulator" for testing and it is successfully parsing
the Accesses in to groups.
Also, I have tried:
Match m = Regex.Match(log, expression);
foreach(string access in m.Groups)
{
// write access
}
it successfully matches 5 groups but the all equal to READ_CONTROL
I have only been playing with regular expressions for some time. I am
working on some code that parses and object 560 event log. I have created
two expressions the first one which works okay is for the actual csv of each
log. The second one parses out the description of the log. My problem is
with the accesses section of the description.
How do I parse multiple groups that have the same name. When I do a for
each through the groups I get the first value for each.
Snippet:
-----------------------------------------------
expression:
Accesses:\t(?

log section:
Accesses: READ_CONTROL
SYNCHRONIZE
ReadData (or ListDirectory)
ReadEA
ReadAttributes
Privileges: -
I would like to do something like
Match m = Regex.Match(log, expression);
foreach(string access in m.Groups["accesses"])
{
//write that access
}
Is this possible?
PS. I am using "The Regulator" for testing and it is successfully parsing
the Accesses in to groups.
Also, I have tried:
Match m = Regex.Match(log, expression);
foreach(string access in m.Groups)
{
// write access
}
it successfully matches 5 groups but the all equal to READ_CONTROL