title: Java: How can I parse and validate a string using RegEx?
body: <p>I have a string </p>
  
  <p><code>some-text+some-text*some-text|some-text</code></p>
  
  <p>where <code>+some-text</code> is optional.</p>
  
  <p><strong>Example:</strong></p>
  
  <p>1) <code>master+single*stuff|Europe</code> (Valid!)</p>
  
  <p>2) <code>slave*stuff|Finland</code> (Valid!)</p>
  
  <p>3) <code>master+single*stuff</code> (Wrong!)</p>
  
  <p>I need to define is this string valid or not.</p>