Blog ala Vidar

SQL, AppFrame and other cool technologies

Regular expressions

I just had a list of 300 SPs that I wanted to check against sys.sysobjects to see which existed and which didn’t. To do this, I need an IN with the list of all my SPs, and I have to add ‘ at the start of the strings and ‘, (apostrophe and comma) at the end of the strings. Instead of doing this manually, which would take ages, and probably cause my arms to tear off my body, I did the following. ctrl + h (search and replace).
In the “Find what:” I added: ^sstp.*
In “Replace with:” I added: ‘’,
Then, tick of the “Use” regular expressions, and do a replace all 🙂 Saved me A LOT of work!

Comments are closed.

%d bloggers like this: