Peters Flexible RenAmiNg Kit (PFrank) Forum Index Peters Flexible RenAmiNg Kit (PFrank)
Support and Discussion Site for the PFrank File/Folder Renaming Tool (http://www3.telus.net/pfrank)
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to add comments?

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



Joined: 09 Mar 2007
Posts: 16
Location: BR

PostPosted: Fri Mar 09, 2007 8:58 pm    Post subject: How to add comments? Reply with quote

Hi there. How can I add comments to the search/replace pattern? I saw on one of your examples that you added #comment after it, but it didn't work for me.

Thanks
Back to top
View user's profile Send private message
admin
Site Admin


Joined: 09 Mar 2007
Posts: 446
Location: Canada

PostPosted: Sat Mar 10, 2007 3:54 am    Post subject: Reply with quote

You have to use the regex verbose flag in the search pattern. The verbose flag lets you add a comment at the end and also lets you add whitespace in and around the pattern. The flag is 'x'. Regex flags are placed at the beginning of search patterns inside a pair of parentheses with a question mark after the left parentheses.
i.e. (?<flags>)

For example:
(?x) [0-9]+ # match on number sequence
THe above example adds a comment at the end.

There are other standard regex flags. e.g. 'i' is used to ignore case.
More than one flag can be used at a time.

For example:
(?xi) [AEIOU]+ # match on vowel sequence (ignore case)
The above example adds a comment and also ignores letter case when pattern matching.

PFrank also defines some flag extensions for extra functionality. Complete information about regex flags and the PFrank extensions can be found in the built-in help.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
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