summaryrefslogtreecommitdiffstats
path: root/Lib/sre_parse.py
Commit message (Collapse)AuthorAgeFilesLines
* Complete the previous effort to factor out constant expressionsRaymond Hettinger2005-02-281-8/+19
| | | | and improve the speed of the if/elif/else blocks.
* Minor aesthetic change in sre_parse.py, as suggested by Mike Coleman.Gustavo Niemeyer2004-09-031-2/+2
|
* Applying modified version of patch #1018386, which fixesGustavo Niemeyer2004-09-031-42/+36
| | | | some escaping bugs in SRE.
* PEP 292 classes Template and SafeTemplate are added to the string module.Barry Warsaw2004-08-251-21/+13
| | | | | | | | This patch includes test cases and documentation updates, as well as NEWS file updates. This patch also updates the sre modules so that they don't import the string module, breaking direct circular imports.
* Simple Optimizations:Raymond Hettinger2004-03-261-73/+92
| | | | | * Factor constant expressions out of loops. * Presize a list being grown to a known length.
* Whitespace normalization.Tim Peters2004-01-181-2/+2
|
* Implemented non-recursive SRE matching.Gustavo Niemeyer2003-10-171-1/+39
|
* Patch #681152: Support escaped Unicode characters in classes. Fixes #612074.Martin v. Löwis2003-04-191-1/+1
| | | | Will backport to 2.2.
* SF patch #720991 by Gary Herron:Guido van Rossum2003-04-141-1/+3
| | | | | | | A small fix for bug #545855 and Greg Chapman's addition of op code SRE_OP_MIN_REPEAT_ONE for eliminating recursion on simple uses of pattern '*?' on a long string.
* Replace boolean test with is None.Raymond Hettinger2002-06-021-2/+2
|
* SF 563203. Replaced 'has_key()' with 'in'.Raymond Hettinger2002-06-011-2/+2
|
* Partial introduction of bools where appropriate.Guido van Rossum2002-04-071-3/+3
|
* SF #515022 remove unused variableNeal Norwitz2002-02-111-1/+0
|
* bug #133283, #477728, #483789, #490573Fredrik Lundh2001-12-091-2/+2
| | | | | | | backed out of broken minimal repeat patch from July also fixed a couple of minor potential resource leaks in pattern_subx (Guido had already fixed the big one)
* Improved error msg when a symbolic group name is redefined. Added docsTim Peters2001-11-031-2/+4
| | | | | | and NEWS. Bugfix candidate? That's a dilemma for Anthony <wink>: /F did fix a longstanding bug here, but the fix can cause code to raise an exception that previously worked by accident.
* SF bug #476912: flag repeated use of the same groupname asFredrik Lundh2001-11-021-1/+3
| | | | the error it really is (and always has been)
* fixed #449964: sre.sub raises an exception if the template contains aFredrik Lundh2001-09-181-4/+4
| | | | | | \g<x> group reference followed by a character escape (also restructured a few things on the way to fixing #449000)
* Added docstrings by Neal Norwitz. This closes SF bug #450980.Fred Drake2001-09-041-0/+2
|
* sre 2.1b2 update:Fredrik Lundh2001-03-221-22/+41
| | | | | | - take locale into account for word boundary anchors (#410271) - restored 2.0's *? behaviour (#233283, #408936 and others) - speed up re.sub/re.subn
* detect attempts to repeat anchors (fixes bug #130748)Fredrik Lundh2001-02-181-0/+3
|
* - restored 1.5.2 compatibility (sorry, eric)Fredrik Lundh2001-02-181-22/+27
| | | | | - removed __all__ cruft from internal modules (sorry, skip) - don't assume ASCII for string escapes (sorry, per)
* bunch more __all__ listsSkip Montanaro2001-02-151-0/+3
| | | | | | also modified check_all function to suppress all warnings since they aren't relevant to what this test is doing (allows quiet checking of regsub, for instance)
* String method conversion.Eric S. Raymond2001-02-091-18/+12
|
* bumped SRE version number to 2.1. cleaned up and added 1.5.2Fredrik Lundh2001-01-161-11/+17
| | | | compatibility patches.
* SRE: stricter pattern syntax checking (covers parts of bug #115900)Fredrik Lundh2001-01-141-7/+17
|
* SRE fixes for 2.1 alpha:Fredrik Lundh2001-01-141-9/+9
| | | | | | | | | | -- 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)
* -- properly reset groups in findall (bug #117612)Fredrik Lundh2000-10-281-2/+12
| | | | | | | | -- 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)
* Fixed too ambitious "nothing to repeat" check. Closes bug #114033.Fredrik Lundh2000-10-071-2/+0
|
* SRE didn't handle character category followed by hyphen inside aFredrik Lundh2000-10-071-0/+2
| | | | | character class. Fix provided by Andrew Kuchling. Closes bug #116251.
* Recompile pattern if (?x) flag was found inside the pattern during theFredrik Lundh2000-10-031-0/+5
| | | | first scan. Closes bug #115040.
* - don't hang if group id is followed by whitespace (closes bug #114660)Fredrik Lundh2000-09-241-1/+1
|
* -- tightened up parsing of octal numbersFredrik Lundh2000-09-021-8/+8
| | | | | -- improved the SRE test harness: don't use asserts, test a few more things (including more boundary conditions)
* SourceForge patch 101396, by an anonymous friend.Tim Peters2000-09-021-1/+1
| | | | "sre_parse.py missing '7' in DIGITS"
* closes bug #112468 (and all the other bugs that surfaced whenFredrik Lundh2000-08-311-28/+47
| | | | I fixed the a bug in the regression test harness...)
* -- reset marks if repeat_one tail doesn't matchFredrik Lundh2000-08-071-4/+4
| | | | | | | (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-1/+1
| | | | | -- added REPEAT_ONE operator -- added ANY_ALL operator (used to represent "(?s).")
* -- fixed width calculations for alternationsFredrik Lundh2000-08-011-5/+5
| | | | | | | -- 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-5/+1
| | | | | | | | | -- 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-76/+79
| | | | | | | | | | | + 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
* - fixed grouping error bugFredrik Lundh2000-07-031-2/+2
| | | | - changed "group" operator to "groupref"
* - added lookbehind support (?<=pattern), (?<!pattern).Fredrik Lundh2000-07-031-3/+9
| | | | | | | | | | | | | | | | | 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-0/+2
| | | | | | | | "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-0/+17
| | | | | | | | | | 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-4/+3
| | | | | | | | | 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.
* - fixed "{ in any other context" bugFredrik Lundh2000-07-011-12/+15
| | | | - minor comment touchups in the C module
* 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-5/+6
| | | | - fixed parser flag propagation (of all stupid bugs...)
* - reverted to "\x is binary byte"Fredrik Lundh2000-06-301-4/+5
| | | | - removed evil tabs from sre_parse and sre_compile
* the mad patcher strikes again:Fredrik Lundh2000-06-301-35/+31
| | | | | | | | | | | | | | | -- 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-0/+19
| | | | - untabified sre_constants.py