View Single Post
Old 03-02-2011, 05:43 AM   #11
Archon
Zealot
Archon , Klaatu Barada Niktu!Archon , Klaatu Barada Niktu!Archon , Klaatu Barada Niktu!Archon , Klaatu Barada Niktu!Archon , Klaatu Barada Niktu!Archon , Klaatu Barada Niktu!Archon , Klaatu Barada Niktu!Archon , Klaatu Barada Niktu!Archon , Klaatu Barada Niktu!Archon , Klaatu Barada Niktu!Archon , Klaatu Barada Niktu!
 
Archon's Avatar
 
Posts: 110
Karma: 5176
Join Date: Dec 2010
Device: Mac OSX, iPad, iPod, & Nook
Quote:
The P in the (?P<group name>) is a special Python requirement to let Python know that a group is to have a name.
Ahh yes that is what I thought.

I use grep based Regex in BBEdit and TextWrangler, and have looked at a little Ruby based Regex through TextMate. I never saw the "?P" thing in any of those flavors of Regex but grep uses local variables for back-references and can be accessed with \1 for the first capture group, Ruby uses $1.

So, the "(?P<group name>)" with the named variable makes the result available to the rest of the program for creating the filename and the metadata for the interface?

Happy Humpday
Archon is offline   Reply With Quote