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 

Replace first character

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



Joined: 03 Feb 2008
Posts: 4

PostPosted: Tue Jun 17, 2008 5:42 pm    Post subject: Replace first character Reply with quote

Please tell me what is wrong with this:

(?Ex) [\-]+ # replace first '_' character with '_-_' in prefix

I'm trying to replace only the first occurrence of the underline character in the file name, but not any subsequent occurrences in that file name, with the three characters shown above.

Thanks in advance for your help Embarassed
Back to top
View user's profile Send private message
admin
Site Admin


Joined: 09 Mar 2007
Posts: 448
Location: Canada

PostPosted: Wed Jun 18, 2008 4:10 am    Post subject: Reply with quote

I'm assuming you want to replace underline characters as you stated and not the dash character as you have specified in the regex.
There are 2 ways to do this:

1)
This method uses the PFrank extension where you put a number in the flags ie. use (?E1x) instead of (?Ex)
The number specifies the number of replacements you'd like to make. In this case it is 1.

Row: 1
Search: '(?E1x) [_]+ # replace first '_' character with '_-_' in prefix'
Replace: '_-_'


or

You can do the following where you isolate the first dash.

Row: 1
Search: '(?Ex)^(.*?)[_]+(.*)$ # replace first '_' character with '_-_' in prefix'
Replace: '\1_-_\2'


Hope this helps!

Peter.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
echonine



Joined: 03 Feb 2008
Posts: 4

PostPosted: Wed Jun 18, 2008 4:02 pm    Post subject: Reply with quote

That works perfectly. Thank you so much for your help. Laughing

Your's is one terrific program! It is so kind of you to provide it to us.
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 -> Plugins 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