Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
604c121e
Commit
604c121e
authored
Aug 23, 2007
by
Georg Brandl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug #1625381: clarify match vs search introduction.
parent
da5f16ab
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
Doc/library/re.rst
Doc/library/re.rst
+5
-5
No files found.
Doc/library/re.rst
View file @
604c121e
...
...
@@ -393,12 +393,12 @@ Matching vs Searching
Python offers two different primitive operations based on regular expressions:
match and search. If you are accustomed to Perl's semantics, the search
operation is what you're looking for. See the :func:`search` function and
corresponding method of compiled regular expression objects
.
**match** checks for a match only at the beginning of the string, while
**search** checks for a match anywhere in the string (this is what Perl does
by default)
.
Note that match may differ from search
using a regular expression beginning with
``'^'``: ``'^'`` matches only at the start of the string, or in
Note that match may differ from search
even when using a regular expression
beginning with
``'^'``: ``'^'`` matches only at the start of the string, or in
:const:`MULTILINE` mode also immediately following a newline. The "match"
operation succeeds only if the pattern matches at the start of the string
regardless of mode, or at the starting position given by the optional *pos*
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment