summaryrefslogtreecommitdiffstats
path: root/Modules/_sre.c
Commit message (Collapse)AuthorAgeFilesLines
* allow longs as indexes to group() (closes #22530)Benjamin Peterson2014-10-011-1/+1
|
* Issue #20283: RE pattern methods now accept the string keyword parametersSerhiy Storchaka2014-03-061-16/+81
| | | | | as documented. The pattern and source keyword parameters are left as deprecated aliases.
* Issue #19405: Fixed outdated comments in the _sre module.Serhiy Storchaka2013-10-271-2/+1
|
* Issue #18672: Fixed format specifiers for Py_ssize_t in debugging output inSerhiy Storchaka2013-09-051-14/+22
| | | | the _sre moduel.
* Issue #17998: Fix an internal error in regular expression engine.Serhiy Storchaka2013-08-031-6/+6
|
* Issue #17016: Get rid of possible pointer wraparounds and integer overflowsSerhiy Storchaka2013-04-131-11/+11
| | | | in the re module. Patch by Nickolai Zeldovich.
* Issue #9669: Protect re against infinite loops on zero-width matching inSerhiy Storchaka2013-02-161-2/+7
| | | | non-greedy repeat. Patch by Matthew Barnett.
* Issue #13169: The maximal repetition number in a regular expression has beenSerhiy Storchaka2013-02-161-6/+12
| | | | | increased from 65534 to 2147483647 (on 32-bit platform) or 4294967294 (on 64-bit).
* use PyInt_FromSsize_t instead of PyLong_FromSsize_t (#10182)Benjamin Peterson2013-01-101-4/+4
|
* rename MathcObject to match object in doctrings for re module (#16760)Andrew Svetlov2012-12-251-1/+1
|
* Issue #16443: Add docstrings to regular expression match objects.Andrew Svetlov2012-12-231-9/+49
| | | | Patch by Anton Kasyanov.
* 1 << 31 is invalid for signed integers, fix it by making 1 unsigned.Gregory P. Smith2012-12-111-2/+2
| | | | Found by Clang trunk's Undefined-Behavior Sanitizer. [more to come]
* Issue #10182: The re module doesn't truncate indices to 32 bits anymore.Antoine Pitrou2012-12-021-5/+5
| | | | Patch by Serhiy Storchaka.
* Issue #1160: Fix compiling large regular expressions on UCS2 builds.Antoine Pitrou2012-11-201-4/+7
| | | | Patch by Serhiy Storchaka.
* Fix Issue 12604 - Use a proper no-op macro expansion for VTRACE macro in _sre.cSenthil Kumaran2011-10-191-1/+1
|
* stop using the old brain-dead interface for providing attributes/methodsBenjamin Peterson2011-05-171-120/+118
| | | | This closes #12099.
* Remove unused variables and a variable initialization.Brett Cannon2010-05-031-6/+6
| | | | Found using Clang's static analyzer.
* ready _sre typesBenjamin Peterson2010-04-061-2/+3
|
* Issue #3299: Fix possible crash in the _sre module when given badAntoine Pitrou2010-01-141-3/+8
| | | | argument values in debug mode. Patch by Victor Stinner.
* Issue #6561: '\d' regular expression should not match characters ofMark Dickinson2009-07-281-1/+1
| | | | | category [No]; only those of category [Nd]. (Backport of r74237 from py3k.)
* - Issue #3629: Fix sre "bytecode" validator for an end case.Guido van Rossum2008-09-101-3/+4
| | | | Reviewed by Amaury.
* Tracker issue 3487: sre "bytecode" verifier.Guido van Rossum2008-08-051-0/+474
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a verifier for the binary code used by the _sre module (this is often called bytecode, though to distinguish it from Python bytecode I put it in quotes). I wrote this for Google App Engine, and am making the patch available as open source under the Apache 2 license. Below are the copyright statement and license, for completeness. # Copyright 2008 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. It's not necessary to include these copyrights and bytecode in the source file. Google has signed a contributor's agreement with the PSF already.
* This reverts r63675 based on the discussion in this thread:Gregory P. Smith2008-06-091-3/+3
| | | | | | | http://mail.python.org/pipermail/python-dev/2008-June/079988.html Python 2.6 should stick with PyString_* in its codebase. The PyBytes_* names in the spirit of 3.0 are available via a #define only. See the email thread.
* Renamed PyString to PyBytesChristian Heimes2008-05-261-3/+3
|
* Silence Coverity false alerts with CIDs #172, #183, #184Christian Heimes2008-01-181-1/+2
|
* Issue 846388. Adds a call to PyErr_CheckSignals toFacundo Batista2008-01-081-0/+8
| | | | | | | | | SRE_MATCH so that signal handlers can be invoked during long regular expression matches. It also adds a new error return value indicating that an exception occurred in a signal handler during the match, allowing exceptions in the signal handler to propagate up to the main loop. Thanks Josh Hoyt and Ralf Schmitt.
* #1629: Renamed Py_Size, Py_Type and Py_Refcnt to Py_SIZE, Py_TYPE and ↵Christian Heimes2007-12-191-1/+1
| | | | Py_REFCNT. Macros for b/w compatibility are available.
* Patch # 1140 (my code, approved by Effbot).Guido van Rossum2007-09-101-17/+8
| | | | | | | | | Make sure the type of the return value of re.sub(x, y, z) is the type of y+x (i.e. unicode if either is unicode, str if they are both str) even if there are no substitutions or if x==z (which triggered various special cases in join_list()). Could be backported to 2.5; no need to port to 3.0.
* PEP 3123: Provide forward compatibility with Python 3.0, while keepingMartin v. Löwis2007-07-211-1/+1
| | | | | backwards compatibility. Add Py_Refcnt, Py_Type, Py_Size, and PyVarObject_HEAD_INIT.
* Cause a PyObject_Malloc() failure to trigger a MemoryError, and thenAndrew M. Kuchling2006-10-041-2/+21
| | | | | | | add 'if (PyErr_Occurred())' checks to various places so that NULL is returned properly. 2.4 backport candidate.
* Try to handle a malloc failure. I'm not entirely sure this is correct.Neal Norwitz2006-08-121-0/+3
| | | | | | There might be something else we need to do to handle the exception. Klocwork # 212-213
* Impl ssize_tNeal Norwitz2006-06-121-93/+98
|
* Make use of METH_O and METH_NOARGS where possible.Georg Brandl2006-05-291-3/+3
| | | | Use Py_UnpackTuple instead of PyArg_ParseTuple where possible.
* METH_NOARGS functions do get called with two args.Georg Brandl2006-05-281-5/+5
|
* Fix C function calling conventions in _sre module.Georg Brandl2006-05-281-38/+18
|
* needforspeed: use PyObject_MALLOC instead of system malloc for smallJack Diederich2006-05-271-4/+4
| | | | allocations. Use PyMem_MALLOC for larger (1k+) chunks. 1%-2% speedup.
* C++ compiler cleanup: proper castsSkip Montanaro2006-04-181-2/+2
|
* Move constructors, add some casts to make C++ compiler happy. Still a problemAnthony Baxter2006-04-121-202/+201
| | | | with the getstring() results in pattern_subx. Will come back to that.
* Rename sre.py -> re.pyNeal Norwitz2006-03-161-2/+4
|
* Thanks to Coverity, these were all reported by their Prevent tool.Neal Norwitz2006-03-071-1/+1
| | | | | All of these (except _lsprof.c) should be backported. Particularly the hotshot change which validates sys.path. Can someone backport?
* Revert backwards-incompatible const changes.Martin v. Löwis2006-02-271-8/+8
|
* _compile(): raise an exception if downcasting to SRE_CODETim Peters2006-01-211-37/+40
| | | | | | | | | | | | | | | | | | loses information: OverflowError: regular expression code size limit exceeded Otherwise the compiled code is gibberish, possibly leading at least to wrong results or (as reported on c.l.py) internal sre errors at match time. I'm not sure how to test this. SRE_CODE is a 2-byte type on my box, and it's easy to create a regexp that causes the new exception to trigger here. But it may be a 4-byte type on other boxes, and creating a regexp large enough to trigger problems there would be pretty crazy. Bugfix candidate.
* Check return result from Py_InitModule*(). This API can fail.Neal Norwitz2006-01-191-0/+2
| | | | Probably should be backported.
* Add const to several API functions that take char *.Jeremy Hylton2005-12-101-8/+8
| | | | | | | | | | | | | | | | | | | In C++, it's an error to pass a string literal to a char* function without a const_cast(). Rather than require every C++ extension module to put a cast around string literals, fix the API to state the const-ness. I focused on parts of the API where people usually pass literals: PyArg_ParseTuple() and friends, Py_BuildValue(), PyMethodDef, the type slots, etc. Predictably, there were a large set of functions that needed to be fixed as a result of these changes. The most pervasive change was to make the keyword args list passed to PyArg_ParseTupleAndKewords() to be a const char *kwlist[]. One cast was required as a result of the changes: A type object mallocs the memory for its tp_doc slot and later frees it. PyTypeObject says that tp_doc is const char *; but if the type was created by type_new(), we know it is safe to cast to char *.
* Fixing bug #1072259 in SRE.Gustavo Niemeyer2004-12-021-7/+10
|
* Add docstrings for regular expression objects and methods.Raymond Hettinger2004-09-241-8/+51
|
* Fixing bug #817234, which made SRE get into an infinite loop onGustavo Niemeyer2004-09-031-5/+3
| | | | | empty final matches with finditer(). New test cases included for this bug and for #581080.
* Moved SunPro warning suppression into pyport.h and out of individualNicholas Bastin2004-07-151-4/+0
| | | | modules and objects.
* Fixed end-of-loop code not reached warning when using SunPro CNicholas Bastin2004-06-171-0/+4
|
* Add weakref support to sockets and re pattern objects.Raymond Hettinger2004-05-311-1/+24
|