B
billy.murray
I have the following text inside a file which I am trying to parse.
I am creating a new RegEx object as follows :-
string strRegex = @"({S:\r?\n)([^}]*)(})"
{S: INTERLOCK FAIL : Tie bar hoist - rotate anticlockwise
I1-T/bar hoist slew handwind eng, input LS/TBHS/HWEa is
LOW
I1-T/bar hoist slew handwind eng, input LS/TBHS/HWEb is
HIGH
}
Calling the match method of strRegex provides no matches, however if I
move 'INTERLOCK FAIL' onto a new line and ensure there is no space
after the '{S:' the match method returns the text I am looking for.
For the life of me I cannot fathom out the expression required to
capture text regardless of whether it is on the same line as the {S:
or not and also if there is white space after the {S:.
I could manually restructure the text if it was only a few changes,
trouble is I have over 1000 files each containing possibly 100s of
these text messages.
Can anoyone out there shed some light on the problem.
Thanks
I am creating a new RegEx object as follows :-
string strRegex = @"({S:\r?\n)([^}]*)(})"
{S: INTERLOCK FAIL : Tie bar hoist - rotate anticlockwise
I1-T/bar hoist slew handwind eng, input LS/TBHS/HWEa is
LOW
I1-T/bar hoist slew handwind eng, input LS/TBHS/HWEb is
HIGH
}
Calling the match method of strRegex provides no matches, however if I
move 'INTERLOCK FAIL' onto a new line and ensure there is no space
after the '{S:' the match method returns the text I am looking for.
For the life of me I cannot fathom out the expression required to
capture text regardless of whether it is on the same line as the {S:
or not and also if there is white space after the {S:.
I could manually restructure the text if it was only a few changes,
trouble is I have over 1000 files each containing possibly 100s of
these text messages.
Can anoyone out there shed some light on the problem.
Thanks