how to remove web address from file name

A swapping-ground for Regular Expression syntax

how to remove web address from file name

Postby skunkhaze » Sat May 02, 2015 5:54 pm

I have file names like those below:

Website Name (Description) (www.google.com).url
Website Name (Description) (www.wikipedia.org).url

or

Website Name -(www.wikipedia.org)-.url

and i want to remove web address including ( ) or -( )-

i tried regex www\..*?(.*) replacing with \1 that i found from http://www.bulkrenameutility.co.uk/forum/viewtopic.php?f=3&t=2255 but it seems to not work for me im geting new namelike google.com.url instead website name
skunkhaze
 
Posts: 2
Joined: Sat May 02, 2015 5:40 pm

Re: how to remove web address from file name

Postby bitmonger » Sun May 03, 2015 11:20 pm

One way you could try is:

Regex (1)
Match: (.+)\(www.+\)

Replace: \1

Include Ext box NOT checked

This takes care of everything but the optional dash. This could be done with a more complex regex, but we can take advantage of the fact that BRU does the rename steps sequentially, in the order shown in the parentheses. Regex is 1 so it takes place first.
We can use the replace function Repl. (3) and put the dash in the Replace field and nothing in the With field.
This will replace any dashes that are left in the filename with nothing.

It worked fine using the filenames given on my machine.

Hope this helps,
Bit
bitmonger
 
Posts: 50
Joined: Sat Sep 22, 2007 5:05 am

Re: how to remove web address from file name

Postby skunkhaze » Mon May 04, 2015 6:01 pm

hello bitmonger, thanks allot for taking your time to help, yes it worked very well
skunkhaze
 
Posts: 2
Joined: Sat May 02, 2015 5:40 pm

Re: how to remove web address from file name

Postby Nicol » Tue May 26, 2015 12:38 pm

You are right but Can't it be possible just by doing find an replace.....
Nicol
 
Posts: 3
Joined: Tue May 19, 2015 6:51 am


Return to Regular Expressions