On Dienstag, 17. März 2009, Forrest Sheng Bao wrote: > I have a problem with regular expression. There are many variables like > __builtins__, __doc__, __file__, __name__. > > I guess they match the pattern __[:alnum:]*__ > > ButI can not remove them from my variable list.
Python does not have predefined character classes like grep, which supports the notation shown above. In Python regexp you would express this as __\w*__ \w is all word characters. > > If I try this pattern, __[a-z]*__ , they disappear from the variable list. > > On Mon, Mar 16, 2009 at 1:12 PM, Detlev Offenbach > > <[email protected]>wrote: > > On Montag, 16. März 2009, Forrest Sheng Bao wrote: > > > Well, suppose I have 100 variables unwanted. Do I have to manually hide > > > them one by one? > > > > No, use a regular expression. -- Detlev Offenbach [email protected] _______________________________________________ Eric mailing list [email protected] http://www.riverbankcomputing.com/mailman/listinfo/eric
