Remove last space

A swapping-ground for Regular Expression syntax

Remove last space

Postby parker » Wed Dec 21, 2011 10:56 pm

Hi

Is it possible to create a expression to do the following?

Match: Find files or folders in which the last character is a space
Replace: Remove the last space

If so could anyone post it?
parker
 
Posts: 9
Joined: Mon Dec 01, 2008 10:30 am

Re: Remove last space

Postby bitmonger » Thu Dec 22, 2011 12:17 am

Give this a try:

In the Regex (1) section.

Match: (.+) $
Note there is a space between the closing parenthesis and the dollar sign.
The $ indicates the end of the filename, so this only matches the names that end in a space.

Replace: \1

Include Ext box NOT checked

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

Re: Remove last space

Postby parker » Thu Dec 22, 2011 12:30 am

Hi

Thanks a lot !

It works perfectly !
parker
 
Posts: 9
Joined: Mon Dec 01, 2008 10:30 am


Return to Regular Expressions