Friday, November 21, 2014

Regular Expression in Notepad++

I have a text file with multiple like of the following

SELECT 1214, N'c7a71de4-6d47-41
SELECT 2173, N'c7a71de4-6d47-41

Where i need to remove the '1214,' part from all rows, but the problem is each row had a different id number. I can't do a simple 'find and replace' , hence had to try via 'regular expression.

I found this page useful:-

http://regexlib.com/CheatSheet.aspx?AspxAutoDetectCookieSupport=1

And this was the solution


Simply:-

^Select.....,


^ = start of string
. = Matches any character except \n

No comments: