0

I am trying to pull some info out of a text file. I am able to match what I need, the problem is that there are too many matches.

The information repeats itself a few times in the text. There is unique text between repeats, but I can't figure out how to get it to stop matching things when it comes across this text. Putting anything but \s after my lookahead seems to break the regex.

Hoping there is a way to do this, and failing that, a way to limit the amount of matches it will grab.

Here is what I have now and a sample of what I'm searching:

                  (?<=anniversary\s|\s<plaintext>).+(?=\s+)



<subpod title=''>
   <plaintext>birth of Gustav Schäfer (1988- ): 25th anniversary
birth of Arrelious Benn (1988- ): 25th anniversary
birth of Brad Silberling (1963- ): 50th anniversary
birth of Robert Lavette (1963- ): 50th anniversary
Harvard University founded (1636): 377th anniversary
Germany joins the League of nations (1926): 87th anniversary
first Miss America crowned (1921): 92nd anniversary
&quot;Blondie&quot; is first published (1930): 83rd anniversary
Galveston Hurricane of 1900 (1900): 113th anniversary
USAir Flight 427 crashes (1994): 19th anniversary</plaintext>
   <img src='http://www4b.wolframalpha.com/Calculate/MSP/MSP18771b2386h4e5i137b400002gg7ehc7hh7c2h17?MSPStoreType=image/gif&amp;s=40'
       alt='birth of Gustav Schäfer (1988- ): 25th anniversary
birth of Arrelious Benn (1988- ): 25th anniversary
birth of Brad Silberling (1963- ): 50th anniversary
birth of Robert Lavette (1963- ): 50th anniversary
Harvard University founded (1636): 377th anniversary
Germany joins the League of nations (1926): 87th anniversary

Any help appreciated

4

0 回答 0