title: Can You Include Unsupported Scripts in \p{Language}?
body: <p>Using Drupal 8.x, PHP 7</p>
  
  <p>Working with some regex replacement I have found <code>\p{Language}</code>, e.g. <code>\p{Armenian}</code>.</p>
  
  <p>I like this approach because it is defensible, I can say 'this supports official scripts and that's it...', and seems flexible enough. But... <code>\p{English}</code> as a value returns an error.</p>
  
  <p>To handle this, I've tried the code below:</p>
  
  <pre><code>// Get current site language.
  $language =  \Drupal::languageManager()-&gt;getCurrentLanguage()-&gt;getName();
  
  // Filter by Language.
  if ($language == 'English') {
    // Search for any word that starts with '@' in English.
    $pattern = '/@(\w+)/';
  }
  else {
    // Search for any word that starts with '@' by language.
    $pattern = '~@(\p{' . $language . '}+)~u';
  }
  
  // Execute replacement.
  $replaceText = preg_replace($pattern, $replacement, $text);
  </code></pre>
  
  <p>Is there a way to expand upon <code>\p{}</code> or incorporate other languages?</p>