|
|
Browse by Tags
All Tags » lookahead » C#
-
Hello, I am using C# in Visual Studio 2008. I have a text file of the entire Bible that I am wanting to either put into a database or write to an XML document. The format of the text is as follows with comments in C# single line comment style to the right of the actual text (example: Genesis //book ...
-
This pattern might do what you need.
(?ms)(?<=^(TO|INFO)\s).*?(?=\s+^(?:INFO|GR)\s)
It will only work reliably if there are no two other lines starting with TO, INFO or GR in the message body, i.e. after the first GR.
It will return one or two matches, depending on the presence of the INFO part. You will have to split those ...
|
|
|