I have written a powershell script that searches my local SQL Server DB project for permissions:
I have written a powershell script which successfully searches the two lines independently. I am now trying to use regex to hit both lines in one search.
According to RegExr searching for the following should work:
Unfortunately once I have transferred this search into powershell it does not work, can anyone assist?
Here's the full search:
I have tried replacing \s with \W and even a combination \W\s*, \W*\s* I have also tried \r and \n as well as a combination \r\n
This issue has subsequently been resolved. It seems powershell does not like the use of wildcards over multiple lines so setting a variable to hold the contents and then searching the variable works well.
answered Aug 13, 2015 at 02:40 PM