title: Regex to match everything before a word. To be used in nant script
body: <p>I was writing some build scripts for my project. I wanted a regex pattern which can match everything before a particular word. For eg: My script looks like this</p>
  
  <pre><code>Create Table ABC(
  id int(50)
  )
  
  --//@UNDO
  
  Drop table ABC
  </code></pre>
  
  <p>I want to match everything before --//@UNDO using <a href="http://nant.sourceforge.net/nightly/latest/help/tasks/regex.html" rel="nofollow">nant regex task</a>. How do I implement it??</p>
  
  <p>I also want it to match everything in the file if --//@UNDO is not present in the file. I am not getting a way around</p>