Tuesday, 27 August 2013

Powershell Regular Expression?

Powershell Regular Expression?

So i have a log files that contains list of file that was copied from 1
folder to another folder.
For example,
12 Aug 17:23:51 C:\Users\Folder_1\File1.exe move to
D:\Users\Folder_1\File1.exe 12 Aug 17:24:33 C:\Users\Folder_2\File2.xml
move to D:\Users\Folder_1\File2.xml
so i wanted to to extract the 2 paths in the above line and write out into
another text file.
For example,
C:\Users\Folder_1\File1.exe D:\Users\Folder_1\File1.exe
I'm not sure how do i write the regular expression here. What i wanted to
achieve in the regex pattern is say C Drive, ignore the length of the
path, and exe files only. Tried something like "(C:\)(.exe)" , doesn't
work.
I would appreciate also if any1 can provide me with a list of special
characters for regex and their uses. For example /d means decimal /D not
Decimal etc. I still can't quite figure out what /< /> /b ? ! character
means though i still saw post of people using it.

No comments:

Post a Comment