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
Create Table ABC(
id int(50)
)
--//@UNDO
Drop table ABC
I want to match everything before –//@UNDO using nant regex task. How do I implement it??
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
This is what I ended up doing
I found the index of –//@UNDO. And depending on its presence I am doing a choose when.. Solved the problem