regex re.search and re.match

X

Xah Lee

in the regex module re:

Note: Match() is not exactly equivalent to Search() with "^". For
example:

re.search(r'^B', 'A\nB',re.M) # succeeds
re.match(r'B', 'A\nB',re.M) # fails

if without the re.M, would re.search and re.match be equivalent?

------------

i wish to spruce up the rewritten re-module doc
http://xahlee.org/perl-python/python_re-write/lib/module-re.html
with people's help.

if at the end it is good, i hope it can find its way into the official
doc.

Xah
(e-mail address removed)
∑ http://xahlee.org/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top