title: Construct pattern that match if there is no punctuation between two characters in R stringr
body: <p>I have a text with several people and their speeches. I need to extract people's names with their party membership. The problem that there are people who are not party members and I want them to be excluded. </p>
  
  <p>The text I am working with is constructed in the following way:</p>
  
  <pre><code>string = 'Author A. B., party member X. Some text. Author G. H., party Y. Some text. Author K. L., somebody. Text that mentions party. Author R. H., party X. Some text.'
  </code></pre>
  
  <p>My desirable outcome is:</p>
  
  <pre><code>'Author A. B., party member X.' 
  'Author G. H., party Y.'
  'Author R. H., party X.'
  </code></pre>
  
  <p>I used </p>
  
  <p><code>str_extract_all(string, '[A-Z]\\w{1,50}\\s[A-Z]\\.\\s[A-Z]\\.,\\s(.*?)party(.*?)\\.')</code> </p>
  
  <p>as a pattern request, it works well with the exception that it also matches <code>Author K. L., somebody. Text that mentions party.</code> and it should be excluded. I tried to implement exception marks <code>[^\\.]</code>  and match for <code>[A-Z]\\w{1,50}\\s[A-Z]\\.\\s[A-Z]\\.,\\s(.*?)[^\\.](.*?)party(.*?)\\.</code> but is gives wring result. </p>
  
  <p>I need to find a match if there is no dot between the name of the author and the word <code>party</code>. If there is a dot between - there should be no match. Can somebody help me with this?</p>