Regex to replace dots in filename with exception

A swapping-ground for Regular Expression syntax

Regex to replace dots in filename with exception

Postby spilet » Wed Jun 21, 2017 9:40 pm

Hello,
I need to replace "." characters With Space except dots who located between digits.


Here is two example:

Before Regular Expression --> AMD.Crimson.Drivers.17.4.3.win.8.1.WHQL.x64.exe
After Regular Expression ----> AMD Crimson Drivers 17.4.3 win 8.1 WHQL x64.exe

Before Regular Expression --> BitTorrent.Pro.7.10.0.5.2.Build.43581.Portable.exe
After Regular Expression ----> BitTorrent Pro 7.10.0.5.2 Build 43581 Portable.exe


Someone can help me ?
Thanks in advance :wink:
spilet
 
Posts: 2
Joined: Wed Jun 21, 2017 9:00 pm

Re: Regex to replace dots in filename with exception

Postby spilet » Tue Jun 27, 2017 5:40 am

I try this in more than one step :

Match :
(.*)(\d{1,})(\s)(\d{1,})(.*)

Replace :
\1\2.\4\5

Does anyone have a better idea?
spilet
 
Posts: 2
Joined: Wed Jun 21, 2017 9:00 pm


Return to Regular Expressions


cron