title: PHP preg_match: "Text-Text-Integer" gives Unknown modifier '-'
body: <p>I have the following code that checks if a domain has the pattern &quot;Text-Text-Integer&quot;. However I get the error Unknown modifier '-' because the - inside is not escaped. I tried to add \ before - but it does not help.</p>
  <pre><code>&lt;?php
  
  $get_keyword_value = &quot;([a-zA-Z])-([a-zA-Z])-([0-9])&quot;;
  $get_current_domain_value = &quot;domain-id-555&quot;;
  
  if(preg_match($get_keyword_value, $get_current_domain_value)){
      echo&quot;Match&quot;;
  }
  else{
      echo&quot;No match&quot;;
  }
  ?&gt;
  </code></pre>