Skip to content
WJunction - Webmaster Forum

Regex group replace inside text file using powersehll

Status
Not open for further replies.
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.

About the author

G
Active Member · Joined
576
Messages
158
Reactions
43
Points

Advertise on WJunction

Reach 1000's of webmasters, hosts & affiliates. Banner & sponsored-thread slots available.

Contact us
Back
Top Bottom