| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
like findall, but returns an iterator (which returns match objects)
instead of a list of strings/tuples.
|
|
|
|
|
| |
template string, and don't call the template compiler if we can
avoid it.
|
|
|
|
| |
(sorry, barry)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
strings, not C strings)
removed USE_PYTHON defines, and related sre.py helpers
skip calling the subx helper if the template is callable.
interestingly enough, this means that
def callback(m):
return literal
result = pattern.sub(callback, string)
is much faster than
result = pattern.sub(literal, string)
|
|
|
|
|
|
| |
check to the test suite.
added a few missing exception checks in the _sre module
|
|
|
|
|
|
|
|
|
| |
removed (conceptually flawed) getliteral helper; the new sub/subn code
uses a faster code path for literal replacement strings, but doesn't
(yet) look for literal patterns.
added STATE_OFFSET macro, and use it to convert state.start/ptr to
char indexes
|
|
|
|
| |
also restored SRE Unicode support for 1.6/2.0/2.1
|
|
|
|
|
|
|
|
| |
compile should raise error for non-strings
SRE bug #432570, 448951:
reset group after failed match
also bumped version number to 2.2.0
|
|
|
|
|
|
| |
\g<x> group reference followed by a character escape
(also restructured a few things on the way to fixing #449000)
|
|
|
|
|
|
|
| |
#462270: sub-tle difference between pre.sub and sre.sub. PRE ignored
an empty match at the previous location, SRE didn't.
also synced with Secret Labs "sreopen" codebase.
|
| |
|
|
|
|
|
|
|
|
| |
- Do not compile unicodeobject, unicodectype, and unicodedata if Unicode is disabled
- check for Py_USING_UNICODE in all places that use Unicode functions
- disables unicode literals, and the builtin functions
- add the types.StringTypes list
- remove Unicode literals from most tests.
|
| |
|
| |
|
|
|
|
|
| |
added copy/deepcopy support to SRE (still not enabled, since it's not
covered by the test suite)
|
|
|
|
|
| |
sure about this one, but test #133283 now works even with the fix in
place, and so does the test suite. we'll see what comes up...
|
| |
|
|
|
|
| |
speedups for certain unicode character ranges.
|
| |
|
|
|
|
| |
conflicts.
|
|
|
|
|
|
| |
- take locale into account for word boundary anchors (#410271)
- restored 2.0's *? behaviour (#233283, #408936 and others)
- speed up re.sub/re.subn
|
| |
|
|
|
|
| |
compatibility patches.
|
| |
|
|
|
|
| |
by compiler/engine mismatches
|
|
|
|
|
|
|
|
| |
(bugs #115903, #115696)
This is based on a patch by Darrel Gallion. I'm not 100%
sure about this fix, but I haven't managed to come up with
any test case it cannot handle...
|
|
|
|
|
|
|
|
|
|
| |
-- added some more docstrings
-- fixed typo in scanner class (#125531)
-- the multiline flag (?m) should't affect the \Z operator (#127259)
-- fixed non-greedy backtracking bug (#123769, #127259)
-- added sre.DEBUG flag (currently dumps the parsed pattern structure)
-- fixed a couple of glitches in groupdict (the #126587 memory leak
had already been fixed by AMK)
|
|
|
|
| |
DECREF
|
|
|
|
|
|
|
|
| |
-- fixed negative lookbehind to work correctly at the beginning
of the target string (bug #117242)
-- improved syntax check; you can no longer refer to a group
inside itself (bug #110866)
|
|
|
|
| |
methods. Closes buglet #115845.
|
| |
|
|
|
|
|
|
|
|
| |
Add definitions of INT_MAX and LONG_MAX to pyport.h.
Remove includes of limits.h and conditional definitions of INT_MAX
and LONG_MAX elsewhere.
This closes SourceForge patch #101659 and bug #115323.
|
|
|
|
|
| |
- added experimental "expand" method to match objects
- don't use the buffer interface on unicode strings
|
|
|
|
| |
None (as documented) from start/end/span. closes bug #113254
|
| |
|
|
|
|
|
|
|
| |
with success. also, check return values from the mark functions.
this addresses (but doesn't really solve) bug #112693, and low-memory
problems reported by jack jansen.
|
|
|
|
|
| |
PyList_Append() always incref's the inserted item. Be sure to decref
it regardless of whether the append succeeds or fails.
|
|
|
|
|
|
|
|
|
| |
(64-bit AIX) This is because the RECURSION_LIMIT is too low. This patch lowers
to recusion limit to 7500 such that the recusion check fires before a segfault.
Fredrik suggested/approved the fix in private email, modulo sre's recusion
limit checking no being necessary when PyOS_CheckStack is implemented for
Windows.
|
|
|
|
| |
for undefined groups
|
| |
|
|
|
|
|
|
|
| |
(this should fix Sjoerd's xmllib problem)
-- added skip field to INFO header
-- changed compiler to generate charset INFO header
-- changed trace messages to support post-mortem analysis
|
|
|
|
| |
for excessive recursion.
|
|
|
|
|
|
|
| |
-- improved error messages
-- factored out SRE_COUNT; the same code is used by
SRE_OP_REPEAT_ONE_TEMPLATE
-- minor cleanups
|
|
|
|
|
| |
-- added REPEAT_ONE operator
-- added ANY_ALL operator (used to represent "(?s).")
|
|
|
|
|
|
|
| |
-- fixed literal check in branch operator
(this broke test_tokenize, as reported by Mark Favas)
-- added REPEAT_ONE operator (still not enabled, though)
-- added some debugging stuff (maxlevel)
|
|
|
|
|
|
|
|
|
| |
-- reverted REPEAT operator to use "repeat context" strategy
(from 0.8.X), but done right this time.
-- got rid of backtracking stack; use nested SRE_MATCH calls
instead (should probably put it back again in 0.9.9 ;-)
-- properly reset state in scanner mode
-- don't use aggressive inlining by default
|
|
|
|
|
|
|
|
|
|
|
| |
+ added "regs" attribute
+ fixed "pos" and "endpos" attributes
+ reset "lastindex" and "lastgroup" in scanner methods
+ removed (?P#id) syntax; the "lastindex" and "lastgroup"
attributes are now always set
+ removed string module dependencies in sre_parse
+ better debugging support in sre_parse
+ various tweaks to build under 1.5.2
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
and a couple of functions that were missed in the previous batches. Not
terribly tested, but very carefully scrutinized, three times.
All these were found by the little findkrc.py that I posted to python-dev,
which means there might be more lurking. Cases such as this:
long
func(a, b)
long a;
long b; /* flagword */
{
and other cases where the last ; in the argument list isn't followed by a
newline and an opening curly bracket. Regexps to catch all are welcome, of
course ;)
|
| |
|
|
|
|
|
|
|
|
| |
- reorganized some code to get rid of -Wall and -W4
warnings
- fixed default argument handling for sub/subn/split
methods (reported by Peter Schneider-Kamp).
|