[TxMt] Python bundle question/possible bug...

Fabry Nicholas F. nick at superb-sublime.com
Sat Mar 17 23:38:53 UTC 2007


Hi - I was looking over the Python language definition, and I came  
upon a regex that I don't understand - or, it might be a bug.  The  
regex is in the FoldingStartMarker:

	<key>foldingStartMarker</key>
	<string>^\s*(def|class)\s+([.a-zA-Z0-9_ b]+)\s*(\((.*)\))?\s*:|\{\s* 
$|\(\s*$|\[\s*$|^\s*"""(?=.)(?!.*""")</string>


The key mysterious part is right in the first character class, which  
I believe is designed to pick out the name of the class/def in question:

[.a-zA-Z0-9_ b]+

Okay, I get it up until the ' b' part.  Essentially, the name of a  
class or def is a series of characters that are in a-z, A-Z, 0-9, or  
are '_' or '.' .  What's the point of the ' b' part?  Was this meant  
to be '\b', signifying a word boundary?    Or is there some deeper  
meaning to space b that I don't understand?  Please forgive if this  
is not an appropriate place for this question; I am rather new (well,  
completely and totally new) to the use of mailing lists.

Brilliant program, btw - it takes time to appreciate it.

Nick




More information about the textmate mailing list