Python2Html regex question
Fredrik Lundh
fredrik at pythonware.com
Tue Aug 30 15:36:31 EDT 2005
Gerard Flanagan wrote:
> Either way, the (c#) source is available for the above formatter and it
> looks like it would be straightforward to create a Python formatter by
> extending a base class and providing the following three things:
>
> 1) a list of python keywords
import keyword
print keyword.kwlist
> 2) a regex to match python comments
import tokenize
print tokenize.Comment
> 3) a regex to match python strings
import tokenize
print tokenize.String
print tokenize.Triple
</F>
More information about the Python-list
mailing list