Regex group replace inside text file using powersehll

Status
Not open for further replies.

Gon

Active Member
538
2014
149
14,160
i am trying to replace regex group text content using powershell.

this is my regex replacement

Code:
find
(?i)(.+S[0-9]+.*e[0-9]+).*(?i)(\.+)*.(?i)(.720p|.1080p|.DVDRip|.BDRip)
replace with
$1$3


this is a sample script i found but it can replace only normal text. i tried regex group but it's giving error. any help please?
Code:
$FileList = Get-ChildItem N:\work\pic\*.txt | select FullName
 
$FileList | ForEach-Object {
    (Get-Content $_.FullName). -replace "test", "me"| Set-Content $_.FullName
}
 
1 comment
Status
Not open for further replies.
Back
Top