How to access the help page of SRE_Pattern?

Peng Yu pengyu.ut at gmail.com
Mon Mar 5 19:13:59 EST 2018


Hi,

>>> import re
>>> prog=re.compile('[a-f]+')
>>> help(prog)

I can use the above command to access SRE_Pattern. But this involves
the creation of an object of the class.

I tried to directly access the class. But it does not work. Does
anybody know if there is a way to directly access the class help page?
Thanks.

>>> help(_sre.SRE_Pattern)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'SRE_Pattern'
>>> help(SRE_Pattern)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'SRE_Pattern' is not defined


-- 
Regards,
Peng



More information about the Python-list mailing list