sre (version 2.1b2)
index
/usr/lib/python2.1/sre.py

# Secret Labs' Regular Expression Engine
#
# re-compatible interface for the sre matching engine
#
# Copyright (c) 1998-2001 by Secret Labs AB.  All rights reserved.
#
# This version of the SRE library can be redistributed under CNRI's
# Python 1.6 license.  For any other use, please contact Secret Labs
# AB (info@pythonware.com).
#
# Portions of this engine have been developed in cooperation with
# CNRI.  Hewlett-Packard provided funding for 1.6 integration and
# other compatibility work.
#

 
Modules
            
copy_reg
sre_compile
sre_parse
string

 
Classes
            
Scanner

 
class Scanner
       
  
__init__(self, lexicon)
scan(self, string)

 
Functions
            
_compile(*key)
_compile_repl(*key)
_expand(pattern, match, template)
_join(seq, sep)
_pickle(p)
_split(pattern, string, maxsplit=0)
_sub(pattern, template, string, count=0)
_subn(pattern, template, string, count=0)
compile(pattern, flags=0)
Compile a regular expression pattern, returning a pattern object.
escape(pattern)
Escape all non-alphanumeric characters in pattern.
findall(pattern, string, maxsplit=0)
Return a list of all non-overlapping matches in the string.
 
If one or more groups are present in the pattern, return a
list of groups; this will be a list of tuples if the pattern
has more than one group.
 
Empty matches are included in the result.
match(pattern, string, flags=0)
Try to apply the pattern at the start of the string, returning
a match object, or None if no match was found.
purge()
Clear the regular expression cache
search(pattern, string, flags=0)
Scan through string looking for a match to the pattern, returning
a match object, or None if no match was found.
split(pattern, string, maxsplit=0)
Split the source string by the occurrences of the pattern,
returning a list containing the resulting substrings.
sub(pattern, repl, string, count=0)
Return the string obtained by replacing the leftmost
non-overlapping occurrences of the pattern in string by the
replacement repl
subn(pattern, repl, string, count=0)
Return a 2-tuple containing (new_string, number).
new_string is the string obtained by replacing the leftmost
non-overlapping occurrences of the pattern in the source
string by the replacement repl.  number is the number of
substitutions that were made.
template(pattern, flags=0)
Compile a template pattern, returning a pattern object

 
Data
             DEBUG = 128
DOTALL = 16
I = 2
IGNORECASE = 2
L = 4
LOCALE = 4
M = 8
MULTILINE = 8
S = 16
T = 1
TEMPLATE = 1
U = 32
UNICODE = 32
VERBOSE = 64
X = 64
_MAXCACHE = 100
__all__ = ['match', 'search', 'sub', 'subn', 'split', 'findall', 'compile', 'purge', 'template', 'escape', 'I', 'L', 'M', 'S', 'X', 'U', 'IGNORECASE', 'LOCALE', 'MULTILINE', 'DOTALL', ...]
__file__ = '/usr/lib/python2.1/sre.pyc'
__name__ = 'sre'
__version__ = '2.1b2'
_cache = {('', 2): <SRE_Pattern object>, ('\n (?P<String>\n \\""" [^"\\\\]* (?:\n ...t]+\n (?P<ImportFromList> [^#;\\n]+ )\n )\n', 88): <SRE_Pattern object>, (' at 0x[0-9a-f]{6,}>$', 0): <SRE_Pattern object>, ('((\\\\[\\\\abfnrtv\\\'"]|\\\\[0-9]..|\\\\x..|\\\\u....)+)', 0): <SRE_Pattern object>, ('([ \t(]|^)([-a-zA-Z0-9_+]*[\x7f-\xff][-a-zA-Z0-9_+\x7f-\xff]*)([ \t)]|\n)', 0): <SRE_Pattern object>, ('=([0-9a-f][0-9a-f])', 2): <SRE_Pattern object>, ('=\\?iso-8859-1\\?q\\?([^? \t\n]+)\\?=', 2): <SRE_Pattern object>, ('[=?\x7f-\xff]', 0): <SRE_Pattern object>, ('[=\x7f-\xff]', 0): <SRE_Pattern object>, ('[A-Z][A-Z0-9_]+$', 0): <SRE_Pattern object>, ...}
_cache_repl = {('', <SRE_Pattern object>): ([], []), ('', <SRE_Pattern object>): ([], []), ('', <SRE_Pattern object>): ([], []), (r'<font color="#c040c0">\1</font>', <SRE_Pattern object>): ([(1, 1)], ['<font color="#c040c0">', None, '</font>']), (r'<font color="#c040c0">\1</font>', <SRE_Pattern object>): ([(1, 1)], ['<font color="#c040c0">', None, '</font>']), (r'<font color="#c040c0">\1</font>', <SRE_Pattern object>): ([(1, 1)], ['<font color="#c040c0">', None, '</font>']), ('>', <SRE_Pattern object>): ([], ['>']), ('>', <SRE_Pattern object>): ([], ['>']), ('>', <SRE_Pattern object>): ([], ['>'])}