Peters Flexible RenAmiNg Kit (PFrank) Forum Index Peters Flexible RenAmiNg Kit (PFrank)
Support and Discussion Site for the PFrank File/Folder Renaming Tool (***NEW HOME PAGE*** "http://pfrank.atwebpages.com")
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

(?<=\D)\.|\.(?=\D) for Files & Folders

 
Post new topic   Reply to topic    Peters Flexible RenAmiNg Kit (PFrank) Forum Index -> Regular Expressions
View previous topic :: View next topic  
Author Message
RR



Joined: 11 Mar 2007
Posts: 50
Location: India

PostPosted: Wed May 02, 2007 5:20 pm    Post subject: (?<=\D)\.|\.(?=\D) for Files & Folders Reply with quote

When I tried to rename a folder named:
Regular.Expression.For.Windows
using this regex
(?<=\D)\.|\.(?=\D) :: (replace with a 'space')
the "Detailed Information (Sortable Mode)" window showed a blank, with
the status bar showing NO CHANGED FILES TO DISPLAY.

What could be wrong? My intention was to rename this folder to
Regular Expression For Windows
I made sure that the 'View > Options > Renaming Type' is set to 'Folders'.


Then again, trying to rename
Regular.Expression.For.Windows.txt
using the same regex line (set to 'Files') brings this up:
Regular Expression For Windows txt

My problem now is: how do I leave the dot immediately preceding the
extension intact? Under the "Pre-Defined Command" the "Prefix" option
was selected.
Back to top
View user's profile Send private message
admin
Site Admin


Joined: 09 Mar 2007
Posts: 448
Location: Canada

PostPosted: Thu May 03, 2007 4:52 am    Post subject: Reply with quote

I tried your regex on a folder called Regular.Expression.For.Windows and it worked fine.
My guess would be that either you are trying to rename the current folder (which is not allowed) or you might have something in your name filter which prevents your folder from being scanned. eg. if you have *.mp3 in the name filter then you would never scan the Regular.Expression.For.Windows file.

Although your regex works it doesn't seem to make much sense. It almost looks like you are trying to used named groups.
A simpler expression that does the same thing would be to search for \. and replace with blank.

The 'prefix' field for pre-defined commands is not used for regex's; it is only used for pre-defined commands that you insert into the custom list.
If you want to restrict the regex's to the prefix you have to use a PFrank extension to the flags feature. The flag you want is 'E' which means to exlude the extension.

Use it in the custom renaming list as follows (don't include the single quotes):

Row: 1
Search: '(?E)\.'
Replace: ' '

This will result in periods being replaced with blanks in the file/folder name prefixes.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
RR



Joined: 11 Mar 2007
Posts: 50
Location: India

PostPosted: Fri May 04, 2007 5:52 pm    Post subject: Reply with quote

Darn right! It's the "trying to rename the current folder (which is not allowed)" that'd botched things up! I shoulda known this by now! Dragged the 'faulty' folder inside another and then it works! Great wizardry!

Now, I'd like to ask: why not make PFrank to rename current folders? This function, I believe would speed up the processing of things.

About the regex '(?<=\D)\.|\.(?=\D)'. You sure hit the point by using '\.' replaced with a space. Guess I'm somewhat regex-drunk (I'm still trying to learn the tricks). I retain this expression for renaming files containing digits, mostly version numbers.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Peters Flexible RenAmiNg Kit (PFrank) Forum Index -> Regular Expressions All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © phpBB Group. Hosted by phpBB.BizHat.com


Start Your Own Video Sharing Site

Free Web Hosting | Free Forum Hosting | FlashWebHost.com | Image Hosting | Photo Gallery | FreeMarriage.com

Powered by PhpBBweb.com, setup your forum now!
For Support, visit Forums.BizHat.com