Regex get sentence with specific word
<p>I have a lot of text which looks like that (this is example):</p>

<blockquote>
  <p>some random strings, content etc, nothing special OPENING BY XZXDS first text i want to get. another random strings, some unnecessary news etc CLOSING second text i want to get. and then some more content and content OPENING BY LLXAS third text i want to get. again boring news, nothing CLOSING fourth text i want to get. and so on...</p>
</blockquote>

<p>I want to get every sentence that contains word : TEXT . for example, in this case I would get:</p>

<blockquote>
  <p>first text i want to get.</p>
  
  <p>second text i want to get.</p>
  
  <p>third text i want to get.</p>
  
  <p>fourth text i want to get.</p>
</blockquote>

<p>The way I think it is possible is:
In my text there is random text, but this text always end "OPENING BY XXXX" or "CLOSING" . So I think that I could get my text which is between word "OPENING BY XXXX" or "CLOSING" and "." (dots). XXX can be different, it needs to be exclude. Can somene help with regex function for this? </p>

<p>Just exlcude everything what is before OPENING BY, exclude one word what is after OPENING BY, get my text till it reaches "."</p>

<p>I used to have something similar, but It was easier because I got sentence with specific word between two dots. I don't have two dots between my sentence now.
I'm adding code for what I used to have:</p>

<pre><code>String pattern = "[^\.]*\bSPECIFICWORD\b[^\.]*"
</code></pre>

<p>I think we can keep second part of this, but first part needs to be modificated.</p>

<p>I need it for my Java app.
Thank you for help.</p>