Commit Graph

111 Commits

Author SHA1 Message Date
Edward Loper 1793dd31de Fixed minor typo in interactive example (extra '.'s in '...' prompts) 2004-09-28 03:12:01 +00:00
Raymond Hettinger 596ba4d89e Granted Noam Raphael's request for minor improvements to the re module and
its documentation.

* Documented that the compiled re methods are supposed to be more full
  featured than their simpilified function counterparts.

* Documented the existing start and stop position arguments for the
  findall() and finditer() methods of compiled regular expression objects.

* Added an optional flags argument to the re.findall() and re.finditer()
  functions.  This aligns their API with that for re.search() and
  re.match().
2004-09-24 03:41:05 +00:00
Gustavo Niemeyer a01a2ee933 Applying modified version of patch #1018386, which fixes
some escaping bugs in SRE.
2004-09-03 17:06:10 +00:00
Gustavo Niemeyer d969775d9c Fixed \versionadded for the (?(id/name)yes|no) expression support. 2003-10-18 15:28:22 +00:00
Gustavo Niemeyer ad3fc44ccb Implemented non-recursive SRE matching. 2003-10-17 22:13:16 +00:00
Raymond Hettinger 5bcc933211 SF bug #803842: Wrong description of regexp concatenation 2003-09-10 18:45:12 +00:00
Raymond Hettinger bed92ee2b2 SF patch #800899: Making "|" directive from REs a bit clearer. 2003-09-10 03:54:50 +00:00
Raymond Hettinger dfa7bd97ff SF #801306: Bad RE in scanf example 2003-09-09 01:30:13 +00:00
Raymond Hettinger 2f3e5483a3 SF bug #732120:An extended definition of "non-overlapping" would save time.
Clarified the meaning of non-overlapping in patterns with zero length
matches.
2003-08-31 05:29:02 +00:00
Raymond Hettinger f17d65da3a SF patch#786531 'the the' typo. Contributed by George Yoshida 2003-08-12 00:01:16 +00:00
Fred Drake 788617f8f0 Remove \versionchanged; the text was too complex for the GNU info
conversion to support.  Keep the content as normal content, with a
note that this applies starting in Python 2.3.
2003-07-16 16:19:08 +00:00
Andrew M. Kuchling c85bf58276 [Bug #732124] Clarify .pos, .endpos by saying 'method' instead of 'function'
Also, put match() description before search(); search() refers to match()
2003-05-13 14:40:24 +00:00
Martin v. Löwis ec31047c0c Use \versionchanged, not \versionadded. 2003-05-03 10:59:13 +00:00
Martin v. Löwis 7829e5661c Patch #731514: Update recursion documentation to mention simple recursion. 2003-05-03 10:57:53 +00:00
Gustavo Niemeyer cf146d31e7 - Included examples documenting how the lastindex member of
match objects work.
2003-04-20 01:48:59 +00:00
Andrew M. Kuchling 69700ef573 Weaken recommendation of Friedl book; fix reference 2003-03-04 14:17:05 +00:00
Andrew M. Kuchling 02a0b3b81a [bug #692016] update description of {m,n} modifier; you can omit the lower bound 2003-03-04 14:12:24 +00:00
Andrew M. Kuchling 85f3227a74 [bug #696771] Remove misleading parenthetical aside 2003-03-04 14:07:51 +00:00
Fred Drake 7af24bd237 Fix example regular expressions that simulate scanf() constructs. 2002-12-03 18:49:17 +00:00
Fred Drake a5a173efbf Fix broken markup.
Closes SF bug #637807.
2002-11-13 17:48:15 +00:00
Fred Drake 3d03968c75 Clarified meaning of \w and \W with respect to the UNICODE and LOCALE flags.
Closes SF bug #635595.
2002-11-12 23:12:54 +00:00
Andrew M. Kuchling 3adefccdcb Use personal e-mail address 2002-10-30 21:08:34 +00:00
Fredrik Lundh e7c38d48ff fixed the mail address in the documentation, too... 2002-10-19 20:22:56 +00:00
Skip Montanaro 2c0d3224fc tightened up the definition of \b and \B some more based upon discussion
after the last checkin.
2002-09-07 18:48:14 +00:00
Skip Montanaro 2c519981fb update docs to reflect that \b considers underscore to be part of a word. 2002-09-06 14:38:23 +00:00
Fred Drake ffefb1df56 Clarify the endpos argument to the rx.match() method.
Closes SF bug #597177.
2002-08-20 13:57:47 +00:00
Fred Drake 5b11bdd0ed SF patch #581414: info reader bug
The "Matching vs. Searching" Info node is unreachable from the Info
program (but is fine in Emacs's Info mode). This patch seems to fix
it.  This is the only occurrence where the info reader fails, so
probably it could be addressed in the python docs as a workaround.
Forwarded the report to the info maintainer.
2002-07-30 17:51:20 +00:00
Fred Drake 53540ab071 Correct the RE equivalent of scanf()'s %x and %X patterns.
Closes SF bug #572169.
2002-06-22 01:07:37 +00:00
Martin v. Löwis 81bdc93d2f Explain octal escapes. Fixes #542226. 2002-04-11 12:24:12 +00:00
Andrew M. Kuchling 2854c478be Remove mention of 'pre' module
(2.2 bugfix candidate?)
2002-04-10 21:28:31 +00:00
Fred Drake 57f8e06e4f Document the finditer() function and method.
This closes SF bug #520904.

Explain that many of the escapes supported by string literals are also
supported by the RE compiler, and list which ones.
This closes SF bug #529923.
2002-03-25 20:22:59 +00:00
Fred Drake a8b663806b Remove extra verb; reported by Detlef Lannert. 2002-03-18 16:45:01 +00:00
Fred Drake 8e0c82a35f Fix stupid typo in example. 2002-03-16 14:01:12 +00:00
Fred Drake f275803fe9 Clarify the descriptions of the positive and negative lookbehind assertions.
Added examples of positive lookbehind assertions.
This closes SF bug #529708.
2002-03-16 05:58:12 +00:00
Fred Drake 9479c958c5 Remove extra indenatation from sample interpreter session.
Remove whitespace from the middle of an inline RE example; it was OK for
the typeset formats, but LaTeX2HTML is more touchy about this.
2002-03-05 04:02:39 +00:00
Skip Montanaro a8e1d81bdc add simple example of avoiding backtracking 2002-03-04 23:08:28 +00:00
Fred Drake b6b2aa6c75 Fix error in explanation of the interaction between $ and MULTILINE mode.
Reported by Steve Alexander.
2002-02-25 18:56:45 +00:00
Fred Drake 7bc6f7ac7b Consistently use \textasciicircum to produce a ^ character.
LaTeX really falls flat on this one!
2002-02-14 15:19:30 +00:00
Fred Drake ed0a71911c Neil Schemenauer suggested a small improvement to one of the example REs. 2001-11-29 20:23:14 +00:00
Fred Drake 1cec7fab1d New section of regular expression examples contributed by Skip Montanaro,
with some extensions and changes from me.
This closes SF patch #472825.
2001-11-29 08:45:22 +00:00
Andrew M. Kuchling 1f774b062e Update obsolete e-mail address, and remove myself as a module author 2001-11-05 21:34:36 +00:00
Tim Peters 7533587d43 Improved error msg when a symbolic group name is redefined. Added docs
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.
2001-11-03 19:35:43 +00:00
Fred Drake 0aa811c527 Use the \note and \warning macros where appropriate. 2001-10-20 04:24:09 +00:00
Tim Peters 9835206268 A regexp example was rendered as
foo\d
when it was clearly intended to render as
    foo$
Fred, is this a right way to fix it?  If not, the earlier place in the
same paragraph that does render as
    foo$
is also wrong.
2001-10-05 20:06:47 +00:00
Eric S. Raymond 46ccd1dae5 Plant a mention in the description of backreferences of the fact that
while \0 doesn't do what one might expect, \g<0> does.
2001-08-28 12:50:03 +00:00
Fred Drake 51629c245a Add a caveat about boundary conditions and RE concatenation, so that the
documents do not make an overly-strong assertion about the properties of
RE concatenation.

Add an example of RE{m,} syntax and what it will and will not match.
2001-08-02 20:52:00 +00:00
Fred Drake e74f8de385 Added an example of a string value for the replacement parameter to
re.sub().
This closes SF bug #446136.

Fixed description of RE modifiers so that RE{#} and RE{#,} are more
clearly described and disambiguated (plain RE{#} had not been described
at all).  Reported by Jeremy Craven via email.
2001-08-01 16:56:51 +00:00
Fred Drake c547b46c06 Be more specific about corner cases in the description of the $ RE syntax,
and include an example where the MULTILINE flag makes a real difference.

This closes SF bug #441600.
2001-07-23 21:14:59 +00:00
Fred Drake f4bdb57e15 Fix return value for m.group() for groups not in the part of the RE that
matched; reported by Paul Moore.

Wrapped several long lines.
2001-07-12 14:13:43 +00:00
Fred Drake 907e76b620 Fix up a few style nits -- avoid "e.g." and "i.e." -- these make
translation more difficult, as well as reading the English more
difficult for non-native speakers.
2001-07-06 20:30:11 +00:00