I am trying to find the first occurance of a text block (American) and everything up to but not including the second occurance of the same text block. The type of content between the two blocks can be anything, including fractions. The number of lines between the two occurances varies.
I am using the following grep search statement to no avail.
((?<=)\AAMERICAN)(\d*[\l\u]*.* *\w*\u*\l* *)((?!)AMERICAN)
Can someone please lead me in the correct direction?
Thanks for your time and help.
(?s) stands for 'single line mode', which you need because you want to span lines, and . doesn't match (i.e. doesn't get past) paragraph boundaries (i.e. \r). Then you simply match everyhing from the first occurrence AMERICAN up to the next occurrence. (?=AMERICAN) stands for 'up to, not including, AMERICAN'.
Thanks very much, Peter. Works like a charm.