Way to search for hypen with surrounding text

English support forum

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
spikey
Member
Member
Posts: 123
Joined: 2005-07-20, 08:37 UTC

Way to search for hypen with surrounding text

Post by *spikey »

I want to search (and then replace) all hyphens in all filenames with a space character.

However, I do NOT want to change a hyphen if it has a space before and after it.

Is there a way to do this easily?
User avatar
Dalai
Power Member
Power Member
Posts: 9364
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Re: Way to search for hypen with surrounding text

Post by *Dalai »

Search for files with

Code: Select all

\w-\w
[X] RegEx to find them. To actually rename them you can use this in the MRT:
Search for:

Code: Select all

(\w)-(\w)
Replace with:

Code: Select all

$1 $2
[X] RegEx

Look at the preview on the MRT and maybe try this with copies of the actual files first!

More details on regular expressions can be found in the TC help file.

HTH

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
Post Reply