title: Latin Regex with symbols
body: <p>I need split a text and get only words, numbers and hyphenated composed-words. I need to get latin words also, then I used <code>\p{L}</code>, which gives me é, ú ü ã, and so forth. The example is:</p>
  
  <pre><code>String myText = "Some latin text with symbols, ? 987 (A la pointe sud-est de l'île se dresse la cathédrale Notre-Dame qui fut lors de son achèvement en 1330 l'une des plus grandes cathédrales d'occident) : ! @ # $ % ^&amp; * ( ) + - _ #$% "  ' : ; &gt; &lt; / \  | ,  here some is wrong… * + () e -"
  
  Pattern pattern = Pattern.compile("[^\\p{L}+(\\-\\p{L}+)*\\d]+");
  String words[] = pattern.split( myText );
  </code></pre>
  
  <p>What is wrong with this regex? Why it matches symbols like <code>"("</code>, <code>"+"</code>, <code>"-"</code>, <code>"*"</code> and <code>"|"</code>?</p>
  
  <p>Some of results are:</p>
  
  <pre><code>dresse     // OK
  sud-est    // OK
  occident)  // WRONG
  987        // OK
  ()         // WRONG
  (a         // WRONG
  *          // WRONG
  -          // WRONG
  +          // WRONG
  (          // WRONG
  |          // WRONG
  </code></pre>
  
  <p>The regex explanation is:</p>
  
  <pre><code>[^\p{L}+(\-\p{L}+)*\d]+
  
   * Word separator will be:
   *     [^  ...  ]  No sequence in:
   *     \p{L}+        Any latin letter
   *     (\-\p{L}+)*   Optionally hyphenated
   *     \d            or numbers
   *     [ ... ]+      once or more.
  </code></pre>