summaryrefslogtreecommitdiffstats
path: root/Lib/sre_compile.py
Commit message (Collapse)AuthorAgeFilesLines
* from the really-stupid-bug department: uppercase literals should matchFredrik Lundh2001-01-151-1/+2
| | | | | | | uppercase strings also when the IGNORECASE flag is set (bug #128899) (also added test cases for recently fixed bugs to the regression suite -- or in other words, check in re_tests.py too...)
* added "magic" number to the _sre module, to avoid weird errors causedFredrik Lundh2001-01-151-0/+2
| | | | by compiler/engine mismatches
* SRE fixes for 2.1 alpha:Fredrik Lundh2001-01-141-3/+3
| | | | | | | | | | -- 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)
* Fixed too ambitious "nothing to repeat" check. Closes bug #114033.Fredrik Lundh2000-10-071-1/+1
|
* -- reset marks if repeat_one tail doesn't matchFredrik Lundh2000-08-071-103/+153
| | | | | | | (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
* final 0.9.8 updates:Fredrik Lundh2000-08-011-25/+26
| | | | | -- added REPEAT_ONE operator -- added ANY_ALL operator (used to represent "(?s).")
* -- fixed width calculations for alternationsFredrik Lundh2000-08-011-2/+3
| | | | | | | -- 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)
* SRE 0.9.8: passes the entire test suiteFredrik Lundh2000-08-011-35/+29
| | | | | | | | | -- 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
* -- SRE 0.9.6 sync. this includes:Fredrik Lundh2000-07-231-2/+12
| | | | | | | | | | | + 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
* maintenance release:Fredrik Lundh2000-07-051-1/+3
| | | | | | | | - 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).
* - fixed grouping error bugFredrik Lundh2000-07-031-6/+13
| | | | - changed "group" operator to "groupref"
* - added lookbehind support (?<=pattern), (?<!pattern).Fredrik Lundh2000-07-031-12/+17
| | | | | | | | | | | | | | | | | the pattern must have a fixed width. - got rid of array-module dependencies; the match pro- gram is now stored inside the pattern object, rather than in an extra string buffer. - cleaned up a various of potential leaks, api abuses, and other minors in the engine module. - use mal's new isalnum macro, rather than my own work- around. - untabified test_sre.py. seems like I removed a couple of trailing spaces in the process...
* - experimental: added two new attributes to the match object:Fredrik Lundh2000-07-021-1/+7
| | | | | | | | "lastgroup" is the name of the last matched capturing group, "lastindex" is the index of the same group. if no group was matched, both attributes are set to None. the (?P#) feature will be removed in the next relase.
* - actually enabled charset anchors in the engine (still notFredrik Lundh2000-07-021-1/+1
| | | | | | | | | | used by the code generator) - changed max repeat value in engine (to match earlier array fix) - added experimental "which part matched?" mechanism to sre; see http://hem.passagen.se/eff/2000_07_01_bot-archive.htm#416954 or python-dev for details.
* -- use charset bitmaps where appropriate. this gives a 5-10%Fredrik Lundh2000-07-021-17/+93
| | | | | | | | | speedup for some tests, including the python tokenizer. -- added support for an optional charset anchor to the engine (currently unused by the code generator). -- removed workaround for array module bug.
* today's SRE update:Fredrik Lundh2000-07-011-1/+1
| | | | | | | | -- changed 1.6 to 2.0 in the file headers -- fixed ISALNUM macro for the unicode locale. this solution isn't perfect, but the best I can do with Python's current unicode database.
* - fixed code generation error in multiline modeFredrik Lundh2000-06-301-2/+2
| | | | - fixed parser flag propagation (of all stupid bugs...)
* - reverted to "\x is binary byte"Fredrik Lundh2000-06-301-1/+1
| | | | - removed evil tabs from sre_parse and sre_compile
* the mad patcher strikes again:Fredrik Lundh2000-06-301-4/+4
| | | | | | | | | | | | | | | -- added pickling support (only works if sre is imported) -- fixed wordsize problems in engine (instead of casting literals down to the character size, cast characters up to the literal size (same as the code word size). this prevents false hits when you're matching a unicode pattern against an 8-bit string. (unfortunately, this broke another test, but I think the test should be changed in this case; more on that on python-dev) -- added sre.purge function (unofficial, clears the cache)
* - fixed lookahead assertions (#10, #11, #12)Fredrik Lundh2000-06-301-50/+50
| | | | - untabified sre_constants.py
* - pedantic: make sure "python -t" doesn't complain...Fredrik Lundh2000-06-301-153/+153
|
* - fixed split behaviour on empty matchesFredrik Lundh2000-06-301-4/+4
| | | | | | - fixed compiler problems when using locale/unicode flags - fixed group/octal code parsing in sub/subn templates
* still trying to figure out how to fix the remainingFredrik Lundh2000-06-291-1/+56
| | | | | | | | | | | | | | | | | | | group reset problem. in the meantime, I added some optimizations: - added "inline" directive to LOCAL (this assumes that AC_C_INLINE does what it's supposed to do). to compile SRE on a non-unix platform that doesn't support inline, you have to add a "#define inline" somewhere... - added code to generate a SRE_OP_INFO primitive - added code to do fast prefix search (enabled by the USE_FAST_SEARCH define; default is on, in this release)
* - fixed another split problemFredrik Lundh2000-06-291-1/+0
| | | | | | | | | (those semantics are weird...) - got rid of $Id$'s (for the moment, at least). in other words, there should be no more "empty" checkins. - internal: some minor cleanups.
* - fixed splitFredrik Lundh2000-06-291-93/+66
| | | | | | | | | | | | | | (test_sre still complains about split, but that's caused by the group reset bug, not split itself) - added more mark slots (should be dynamically allocated, but 100 is better than 32. and checking for the upper limit is better than overwriting the memory ;-) - internal: renamed the cursor helper class - internal: removed some bloat from sre_compile
* - removed "alpha only" licensing restrictionFredrik Lundh2000-06-291-3/+0
| | | | | - removed some hacks that worked around 1.6 alpha bugs - removed bogus test code from sre_parse
* towards 1.6b1Fredrik Lundh2000-06-291-27/+39
|
* Fredrik Lundh: here's the 96.6% version of SREJeremy Hylton2000-06-011-64/+70
|
* Fredrik Lundh: new snapshot. Mostly reindented.Guido van Rossum2000-04-101-125/+125
| | | | | This one should work with unicode expressions, and compile a bit more silently.
* This patch looks large, but it just deletes the ^M characters andAndrew M. Kuchling2000-04-021-124/+124
| | | | untabifies the files. No actual code changes were made.
* Added Fredrik Lundh's sre module and its supporting cast.Guido van Rossum2000-03-311-0/+187
NOTE: THIS IS VERY ROUGH ALPHA CODE!