title: What regex expression can I use to match a whole word up to, but not including, an equal sign
body: <p>I want to create an expression which will select the first word immediately preceding every equals sign. </p>
  
  <p>For example, take this sentence</p>
  
  <p>"execute code='hello I am a program'"</p>
  
  <p>In the example above, I just the word 'code', since it is the first word to precede an equals sign</p>
  
  <p>The closest I've come to it is [^\s]+(?:[=]), which selects 'code='</p>
  
  <p>If the sentence were 
  "execute code = 'hello I am a program'" (all I did was add spaces)</p>
  
  <p>then the selection we want would be 'code' still, but my current expression wouldn't find anything</p>
  
  <p>I've tried other expressions that are also partially correct, such as [a-zA-Z]+[^=]</p>
  
  <p>This one does would print out 'execute code' and 'execute code ' for both the cases above, respectively. </p>
  
  <p>Please help, I cannot figure this out</p>