I want to replace -space- followed by "D" followed by 4 nums

A swapping-ground for Regular Expression syntax

I want to replace -space- followed by "D" followed by 4 nums

Postby jamserra » Sun Jan 27, 2013 7:31 am

I want to replace -space- followed by "D" followed by 4 numbers. It will be replace everything from the point it was found until the end. For example:

A Nightmare On Elm Street 2010 D2406B8 horror.avi
to
A Nightmare On Elm Street 2010.avi

and

Blood Night The Legend Of Mary Hatchet 2009 D2326B8 horror.avi
to
Blood Night The Legend Of Mary Hatchet 2009.avi

Greatly appreciate your help!
jamserra
 
Posts: 1
Joined: Sun Jan 27, 2013 7:27 am

Remove parts from given start till the end

Postby Stefan » Sun Jan 27, 2013 7:58 pm

FROM:
A Nightmare On Elm Street 2010 D2406B8 horror.avi
Blood Night The Legend Of Mary Hatchet 2009 D2326B8 horror.avi

TO:
A Nightmare On Elm Street 2010.avi
Blood Night The Legend Of Mary Hatchet 2009.avi

RULE:
Remove "-space-" followed by "D" followed by 4 numbers till the end.

USE:
RegEx(1)
Find: "^(.+) - D\d\d\d\d.+$"
Repla: "\1"



Please use better subjects next time!
.
Stefan
 
Posts: 736
Joined: Fri Mar 11, 2005 7:46 pm
Location: Germany, EU


Return to Regular Expressions


cron