All Samples(70254) | Call(69819) | Derive(0) | Import(435)
Compile a regular expression pattern, returning a pattern object.
def compile(pattern, flags=0):
"Compile a regular expression pattern, returning a pattern object."
return _compile(pattern, flags)
from antlr import EOF, CommonToken as Tok, TokenStream, TokenStreamException import struct import ExcelFormulaParser from re import compile as recompile, match, LOCALE, UNICODE, IGNORECASE int_const_pattern = recompile(r"\d+") flt_const_pattern = recompile(r"\d*\.\d+(?:[Ee][+-]?\d+)?") str_const_pattern = recompile(r'["][^"]*["]') #range2d_pattern = recompile(r"\$?[A-I]?[A-Z]\$?\d+:\$?[A-I]?[A-Z]\$?\d+") ref2d_pattern = recompile(r"\$?[A-I]?[A-Z]\$?\d+") true_pattern = recompile(r"TRUE", IGNORECASE) false_pattern = recompile(r"FALSE", IGNORECASE) name_pattern = recompile(r"[\.\w]+", LOCALE)
src/p/y/python-sneakylang-HEAD/sneakylang/register.py python-sneakylang(Download)
# -*- coding: utf-8 -*- from re import compile, UNICODE from expanders import Expander from macro_caller import get_macro_name, expand_macro_from_stream
def add(self, parser):
if parser.start is not None:
for start in parser.start:
if isinstance(start, str):
start = start.decode('utf-8')
self.parser_start[start] = (compile(u''.join([u'^', start]), flags=UNICODE), parser)
#self.parser_start_compiled[compile(''.join(['^', start]))] = parser
src/p/y/pyexcelerator-HEAD/pyExcelerator/ExcelFormulaLexer.py pyexcelerator(Download)
from antlr import EOF, CommonToken as Tok, TokenStream, TokenStreamException import struct import ExcelFormulaParser from re import compile as recompile, match, LOCALE, UNICODE, IGNORECASE int_const_pattern = recompile(r"\d+") flt_const_pattern = recompile(r"\d*\.\d+(?:[Ee][+-]?\d+)?") str_const_pattern = recompile(r'["][^"]*["]') #range2d_pattern = recompile(r"\$?[A-I]?[A-Z]\$?\d+:\$?[A-I]?[A-Z]\$?\d+") ref2d_pattern = recompile(r"\$?[A-I]?[A-Z]\$?\d+") true_pattern = recompile(r"TRUE", IGNORECASE) false_pattern = recompile(r"FALSE", IGNORECASE) name_pattern = recompile(r"[\.\w]+", LOCALE)
src/p/y/pyexcelerator-0-0.6.4a/pyExcelerator/ExcelFormulaLexer.py pyExcelerator(Download)
from antlr import EOF, CommonToken as Tok, TokenStream, TokenStreamException import struct import ExcelFormulaParser from re import compile as recompile, match, LOCALE, UNICODE, IGNORECASE int_const_pattern = recompile(r"\d+") flt_const_pattern = recompile(r"\d*\.\d+(?:[Ee][+-]?\d+)?") str_const_pattern = recompile(r'["][^"]*["]') #range2d_pattern = recompile(r"\$?[A-I]?[A-Z]\$?\d+:\$?[A-I]?[A-Z]\$?\d+") ref2d_pattern = recompile(r"\$?[A-I]?[A-Z]\$?\d+") true_pattern = recompile(r"TRUE", IGNORECASE) false_pattern = recompile(r"FALSE", IGNORECASE) name_pattern = recompile(r"[\.\w]+", LOCALE)
src/p/y/pyexcel-HEAD/src/ExcelFormulaLexer.py pyexcel(Download)
from antlr import EOF, CommonToken as Tok, TokenStream, TokenStreamException import struct import ExcelFormulaParser from re import compile as recompile, match, LOCALE, UNICODE, IGNORECASE int_const_pattern = recompile(r"\d+") flt_const_pattern = recompile(r"\d*\.\d+(?:[Ee][+-]?\d+)?") str_const_pattern = recompile(r'["][^"]*["]') #range2d_pattern = recompile(r"\$?[A-I]?[A-Z]\$?\d+:\$?[A-I]?[A-Z]\$?\d+") ref2d_pattern = recompile(r"\$?[A-I]?[A-Z]\$?\d+") true_pattern = recompile(r"TRUE", IGNORECASE) false_pattern = recompile(r"FALSE", IGNORECASE) name_pattern = recompile(r"[\.\w]+", LOCALE)
src/i/r/ironruby-HEAD/External.LCA_RESTRICTED/Languages/IronPython/27/Lib/_strptime.py ironruby(Download)
import time import locale import calendar from re import compile as re_compile from re import IGNORECASE from re import escape as re_escape from datetime import date as datetime_date
# The sub() call escapes all characters that might be misconstrued
# as regex syntax. Cannot use re.escape since we have to deal with
# format directives (%m, etc.).
regex_chars = re_compile(r"([\\.^$*+?\(\){}\[\]|])")
format = regex_chars.sub(r"\\\1", format)
whitespace_replacement = re_compile('\s+')
format = whitespace_replacement.sub('\s+', format)
def compile(self, format):
"""Return a compiled re object for the format string."""
return re_compile(self.pattern(format), IGNORECASE)
_cache_lock = _thread_allocate_lock()
# DO NOT modify _TimeRE_cache or _regex_cache without acquiring the cache lock
# first!
src/i/r/ironruby-HEAD/External.LCA_RESTRICTED/Languages/CPython/27/Lib/_strptime.py ironruby(Download)
import time import locale import calendar from re import compile as re_compile from re import IGNORECASE from re import escape as re_escape from datetime import date as datetime_date
# The sub() call escapes all characters that might be misconstrued
# as regex syntax. Cannot use re.escape since we have to deal with
# format directives (%m, etc.).
regex_chars = re_compile(r"([\\.^$*+?\(\){}\[\]|])")
format = regex_chars.sub(r"\\\1", format)
whitespace_replacement = re_compile('\s+')
format = whitespace_replacement.sub('\s+', format)
def compile(self, format):
"""Return a compiled re object for the format string."""
return re_compile(self.pattern(format), IGNORECASE)
_cache_lock = _thread_allocate_lock()
# DO NOT modify _TimeRE_cache or _regex_cache without acquiring the cache lock
# first!
src/j/y/jython-HEAD/sandbox/tobias/jython/CPythonLib/_strptime.py jython(Download)
import time import locale import calendar from re import compile as re_compile from re import IGNORECASE from re import escape as re_escape from datetime import date as datetime_date
# The sub() call escapes all characters that might be misconstrued
# as regex syntax. Cannot use re.escape since we have to deal with
# format directives (%m, etc.).
regex_chars = re_compile(r"([\\.^$*+?\(\){}\[\]|])")
format = regex_chars.sub(r"\\\1", format)
whitespace_replacement = re_compile('\s+')
format = whitespace_replacement.sub('\s+', format)
def compile(self, format):
"""Return a compiled re object for the format string."""
return re_compile(self.pattern(format), IGNORECASE)
_cache_lock = _thread_allocate_lock()
# DO NOT modify _TimeRE_cache or _regex_cache without acquiring the cache lock
# first!
src/p/y/pypy3-HEAD/lib-python/3.1.2/_strptime.py pypy3(Download)
import time import locale import calendar from re import compile as re_compile from re import IGNORECASE, ASCII from re import escape as re_escape from datetime import date as datetime_date
# The sub() call escapes all characters that might be misconstrued
# as regex syntax. Cannot use re.escape since we have to deal with
# format directives (%m, etc.).
regex_chars = re_compile(r"([\\.^$*+?\(\){}\[\]|])")
format = regex_chars.sub(r"\\\1", format)
whitespace_replacement = re_compile('\s+')
format = whitespace_replacement.sub('\s+', format)
def compile(self, format):
"""Return a compiled re object for the format string."""
return re_compile(self.pattern(format), IGNORECASE)
_cache_lock = _thread_allocate_lock()
# DO NOT modify _TimeRE_cache or _regex_cache without acquiring the cache lock
# first!
src/j/y/jython-HEAD/jython/CPythonLib/_strptime.py jython(Download)
import time import locale import calendar from re import compile as re_compile from re import IGNORECASE from re import escape as re_escape from datetime import date as datetime_date
# The sub() call escapes all characters that might be misconstrued
# as regex syntax. Cannot use re.escape since we have to deal with
# format directives (%m, etc.).
regex_chars = re_compile(r"([\\.^$*+?\(\){}\[\]|])")
format = regex_chars.sub(r"\\\1", format)
whitespace_replacement = re_compile('\s+')
format = whitespace_replacement.sub('\s+', format)
def compile(self, format):
"""Return a compiled re object for the format string."""
return re_compile(self.pattern(format), IGNORECASE)
_cache_lock = _thread_allocate_lock()
# DO NOT modify _TimeRE_cache or _regex_cache without acquiring the cache lock
# first!
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 Next