XXXasdf23s5\r\n
asdflkoirfn329i4\r\n
sef29384ewrj28039\r\n
XXX123sd3t334\r\n
sdorfu23984rr\r\n
sdflk2893rjf\r\n
weirj2983jhwer2398\r\n
XXX12356789\r\n
4w3ujr523q938er\r\n
basically I am searching for sections that begin with XXX but I don't know what the end will be. All I know is that the next section will definitely start with 'XXX'
Can I search for ^XXX.*\r\n(.*\r\n)*XXX
but add something to the regular expression to backtrack to before the next XXX that I matched and ignore it? I want my match to exclude it.
(I tried (?=XXX) but I could not get it to work)
Expand|Select|Wrap|Line Numbers
- System.Text.RegularExpressions.Regex xxxRegex = new System.Text.RegularExpressions.Regex(@"^XXX\|.*\r\n(.*\r\n)+(?=XXX)", System.Text.RegularExpressions.RegexOptions.Multiline | System.Text.RegularExpressions.RegexOptions.Compiled);