Vega strike Python Modules doc  0.5.1
Documentation of the " Modules " folder of Vega strike
 All Data Structures Namespaces Files Functions Variables
sre Namespace Reference

Data Structures

class  Scanner
 

Functions

def match
 
def search
 
def sub
 
def subn
 
def split
 
def findall
 
def finditer
 
def compile
 
def purge
 
def template
 
def escape
 

Variables

list __all__
 
string __version__ = "2.2.1"
 
 I = sre_compile.SRE_FLAG_IGNORECASE
 
 L = sre_compile.SRE_FLAG_LOCALE
 
 U = sre_compile.SRE_FLAG_UNICODE
 
 M = sre_compile.SRE_FLAG_MULTILINE
 
 S = sre_compile.SRE_FLAG_DOTALL
 
 X = sre_compile.SRE_FLAG_VERBOSE
 
 T = sre_compile.SRE_FLAG_TEMPLATE
 
 DEBUG = sre_compile.SRE_FLAG_DEBUG
 
 error = sre_compile.error
 
dictionary _cache = {}
 
dictionary _cache_repl = {}
 
tuple _pattern_type = type(sre_compile.compile("", 0))
 
int _MAXCACHE = 100
 

Function Documentation

def sre.compile (   pattern,
  flags = 0 
)

Definition at line 176 of file sre.py.

177 def compile(pattern, flags=0):
178  "Compile a regular expression pattern, returning a pattern object."
179  return _compile(pattern, flags)
def sre.escape (   pattern)

Definition at line 189 of file sre.py.

190 def escape(pattern):
191  "Escape all non-alphanumeric characters in pattern."
192  s = list(pattern)
193  for i in range(len(pattern)):
194  c = pattern[i]
195  if not ("a" <= c <= "z" or "A" <= c <= "Z" or "0" <= c <= "9"):
196  if c == "\000":
197  s[i] = "\\000"
198  else:
199  s[i] = "\\" + c
200  return _join(s, pattern)
201 
202 # --------------------------------------------------------------------
203 # internals
def sre.findall (   pattern,
  string 
)
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.

Definition at line 158 of file sre.py.

159 def findall(pattern, string):
160  """Return a list of all non-overlapping matches in the string.
161 
162  If one or more groups are present in the pattern, return a
163  list of groups; this will be a list of tuples if the pattern
164  has more than one group.
165 
166  Empty matches are included in the result."""
167  return _compile(pattern, 0).findall(string)
def sre.finditer (   pattern,
  string 
)
Return an iterator over all non-overlapping matches in the
string.  For each match, the iterator returns a match object.

Empty matches are included in the result.

Definition at line 169 of file sre.py.

170  def finditer(pattern, string):
171  """Return an iterator over all non-overlapping matches in the
172  string. For each match, the iterator returns a match object.
173 
174  Empty matches are included in the result."""
175  return _compile(pattern, 0).finditer(string)
def sre.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.

Definition at line 129 of file sre.py.

130 def match(pattern, string, flags=0):
131  """Try to apply the pattern at the start of the string, returning
132  a match object, or None if no match was found."""
133  return _compile(pattern, flags).match(string)
def sre.purge ( )

Definition at line 180 of file sre.py.

181 def purge():
182  "Clear the regular expression cache"
183  _cache.clear()
184  _cache_repl.clear()
def sre.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.

Definition at line 134 of file sre.py.

135 def search(pattern, string, flags=0):
136  """Scan through string looking for a match to the pattern, returning
137  a match object, or None if no match was found."""
138  return _compile(pattern, flags).search(string)
def sre.split (   pattern,
  string,
  maxsplit = 0 
)
Split the source string by the occurrences of the pattern,
returning a list containing the resulting substrings.

Definition at line 153 of file sre.py.

154 def split(pattern, string, maxsplit=0):
155  """Split the source string by the occurrences of the pattern,
156  returning a list containing the resulting substrings."""
157  return _compile(pattern, 0).split(string, maxsplit)
def sre.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

Definition at line 139 of file sre.py.

140 def sub(pattern, repl, string, count=0):
141  """Return the string obtained by replacing the leftmost
142  non-overlapping occurrences of the pattern in string by the
143  replacement repl"""
144  return _compile(pattern, 0).sub(repl, string, count)
def sre.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.

Definition at line 145 of file sre.py.

146 def subn(pattern, repl, string, count=0):
147  """Return a 2-tuple containing (new_string, number).
148  new_string is the string obtained by replacing the leftmost
149  non-overlapping occurrences of the pattern in the source
150  string by the replacement repl. number is the number of
151  substitutions that were made."""
152  return _compile(pattern, 0).subn(repl, string, count)
def sre.template (   pattern,
  flags = 0 
)

Definition at line 185 of file sre.py.

186 def template(pattern, flags=0):
187  "Compile a template pattern, returning a pattern object"
188  return _compile(pattern, flags|T)

Variable Documentation

list __all__
Initial value:
1 = [ "match", "search", "sub", "subn", "split", "findall",
2  "compile", "purge", "template", "escape", "I", "L", "M", "S", "X",
3  "U", "IGNORECASE", "LOCALE", "MULTILINE", "DOTALL", "VERBOSE",
4  "UNICODE", "error" ]

Definition at line 101 of file sre.py.

string __version__ = "2.2.1"

Definition at line 106 of file sre.py.

dictionary _cache = {}

Definition at line 204 of file sre.py.

dictionary _cache_repl = {}

Definition at line 205 of file sre.py.

int _MAXCACHE = 100

Definition at line 209 of file sre.py.

tuple _pattern_type = type(sre_compile.compile("", 0))

Definition at line 207 of file sre.py.

DEBUG = sre_compile.SRE_FLAG_DEBUG

Definition at line 121 of file sre.py.

error = sre_compile.error

Definition at line 124 of file sre.py.

I = sre_compile.SRE_FLAG_IGNORECASE

Definition at line 112 of file sre.py.

L = sre_compile.SRE_FLAG_LOCALE

Definition at line 113 of file sre.py.

M = sre_compile.SRE_FLAG_MULTILINE

Definition at line 115 of file sre.py.

S = sre_compile.SRE_FLAG_DOTALL

Definition at line 116 of file sre.py.

T = sre_compile.SRE_FLAG_TEMPLATE

Definition at line 120 of file sre.py.

U = sre_compile.SRE_FLAG_UNICODE

Definition at line 114 of file sre.py.

X = sre_compile.SRE_FLAG_VERBOSE

Definition at line 117 of file sre.py.