title: Regular Expression to get all characters before "-"
body: <p>How can I get the string before the character <code>"-"</code> using regular expressions?</p>
  
  <p>For example, I have <code>"text-1"</code> and I want to return <code>"text"</code>.</p>