[frames | no frames]

Module sre

Function Summary
  match(pattern, string, flags)
Try to apply the pattern at the start of the string, returning a match object, or None if no match was found.
  search(pattern, string, flags)
Scan through string looking for a match to the pattern, returning a match object, or None if no match was found.
  sub(pattern, repl, string, count)
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)
Return a 2-tuple containing (new_string, number).
  split(pattern, string, maxsplit)
Split the source string by the occurrences of the pattern, returning a list containing the resulting substrings.
  findall(pattern, string, maxsplit)
Return a list of all non-overlapping matches in the string.
  compile(pattern, flags)
Compile a regular expression pattern, returning a pattern object.
  purge()
Clear the regular expression cache
  template(pattern, flags)
Compile a template pattern, returning a pattern object
  escape(pattern)
Escape all non-alphanumeric characters in pattern.

Variable Summary
int I
int L
int M
int S
int X
int U
int IGNORECASE
int LOCALE
int MULTILINE
int DOTALL
int VERBOSE
int UNICODE

Function Details

compile

compile(pattern, flags=0)

Compile a regular expression pattern, returning a pattern object.

escape

escape(pattern)

Escape all non-alphanumeric characters in pattern.

findall

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

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

purge()

Clear the regular expression cache

search

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

split(pattern, string, maxsplit=0)

Split the source string by the occurrences of the pattern, returning a list containing the resulting substrings.

sub

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

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

template(pattern, flags=0)

Compile a template pattern, returning a pattern object

Variable Details

DOTALL

Type:
int
Value:
16                                                                     

I

Type:
int
Value:
2                                                                      

IGNORECASE

Type:
int
Value:
2                                                                      

L

Type:
int
Value:
4                                                                      

LOCALE

Type:
int
Value:
4                                                                      

M

Type:
int
Value:
8                                                                      

MULTILINE

Type:
int
Value:
8                                                                      

S

Type:
int
Value:
16                                                                     

U

Type:
int
Value:
32                                                                     

UNICODE

Type:
int
Value:
32                                                                     

VERBOSE

Type:
int
Value:
64                                                                     

X

Type:
int
Value:
64                                                                     

Generated by Epydoc 1.1 on Sat Oct 19 05:34:52 2002 http://epydoc.sf.net