9
I have a directory with some C#files. In these files there are several SQL query codes.
I need to list all SELECT commands in these files using Powershell.
The commands start with SELECT
and end with ;
and may have more than one line, as the example:
SQL = "SELECT t.a, t.b, t.c FROM uf_GetResultSet(4, 1, 0, 0, 'G', 0, 0, 0) t";
(...)
SQL = "SELECT t.a, t.b, t.c" +
"FROM uf_GetResultSet(4, 3, 0, 0, 'C', " + idSomeThing.ToString() + ", 0, 0) t";
The regex standard SELECT .+[\r\n]*.+";
fits me perfectly using Notepad++, but I don’t know how to adapt it in PS.