How can I remove last word in files name

A swapping-ground for Regular Expression syntax

How can I remove last word in files name

Postby ramy88 » Thu Apr 30, 2015 3:48 pm

I have several file names , I want to know how can I remove the last word of this file name

Ex : My name is ramy

You are smart and intelligent boy

To : My name is

You are smart and intelligent

Any Help Please !!!!!!!!!!
ramy88
 
Posts: 3
Joined: Thu Apr 30, 2015 3:38 pm

Re: How can I remove last word in files name

Postby Stefan » Thu Apr 30, 2015 6:26 pm

Hi ramy,


FROM:
My name is ramy
You are smart and intelligent boy

TO:
My name is
You are smart and intelligent



best use regular expression,
search for everything till last space (just before last word)
and store that for later reuse as group "\1"


USE:

RegEx(1)
Match: (.+)~.+
Replace: \1

(Instead of the ~ sign add a blank space)


HTH?
Stefan
 
Posts: 736
Joined: Fri Mar 11, 2005 7:46 pm
Location: Germany, EU

Re: How can I remove last word in files name

Postby ramy88 » Thu Apr 30, 2015 8:36 pm

Hi Stefan How are you ?
Thanks For your Reply
1- I put all of my pictures that I want to remove last word of its name in folder
2- I opened BRU , Put the Regex that you post in the past reply in Match and Put /1 in Replace but When I pressed rename Nothing happened ...

I cant know what do mean ( store that for later reuse as group "\1" )
I dont have any experience about Regular Expression .

Tell me What wrong I do Please
ramy88
 
Posts: 3
Joined: Thu Apr 30, 2015 3:38 pm

Re: How can I remove last word in files name

Postby Stefan » Thu Apr 30, 2015 11:07 pm

Did you select the files you want to become renamed in the Names column?

Did you think about using a space instead of ~ ?

Did you really use /1 instead of \1 ?

Did you read the help to get a glue what could went wrong?


If you can't figure it out, copy your RegEx Match and the Replace expression and post them both here.



 
Stefan
 
Posts: 736
Joined: Fri Mar 11, 2005 7:46 pm
Location: Germany, EU

Re: How can I remove last word in files name

Postby ramy88 » Thu Apr 30, 2015 11:40 pm

I made everything correctly stefan , Regex works well when I named the files english But My problem is that my Files is in Arabic Language not English

Look at this picture that can make you understand me

Image

The picture name is in arabic language is converted to .jpg
The picture name is in English language is converted correctly

Is BRU support Regex For Unicode Language ????

( I want you tell me this Regex But For Arabic Languge Please )


Thank you
ramy88
 
Posts: 3
Joined: Thu Apr 30, 2015 3:38 pm

Re: How can I remove last word in files name

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

I think its doesn't support Arabic language.
Nicol
 
Posts: 3
Joined: Tue May 19, 2015 6:51 am

RegEx engine only support standard English letters.

Postby Stefan » Tue May 26, 2015 12:57 pm

ramy88 wrote:I made everything correctly stefan , Regex works well when I named the files english But My problem is that my Files is in Arabic Language not English



Sorry, I missed your reply.

Nicol is right, this RegEx engine only support standard English letters. No Arabic or German umlauts or such.



 
Stefan
 
Posts: 736
Joined: Fri Mar 11, 2005 7:46 pm
Location: Germany, EU

Re: How can I remove last word in files name

Postby Admin » Wed May 27, 2015 1:30 am

That will be improved in the upcoming release of BRU.
Admin
Site Admin
 
Posts: 1484
Joined: Tue Mar 08, 2005 8:39 pm


Return to Regular Expressions