On 7/14/06, Kent Johnson <[EMAIL PROTECTED]> wrote:

> But for this particular application you might as well use
> line.startswith('b') instead of a regex.

Ah yes, that makes sense.

Incidentally continuing my reading of the HOWTO I have sat and puzzled
for about 30 mins on the difference the MULTILINE flag makes.  I can't
quite see the difference.  I *think* it is as follows:

Under normal circumstances, ^ matches the start of a line, only.  On a
line by line basis.

With the re.M flag, we get a match after *any* newline?

Similarly with $ - under normal circumstances, $ matches the end of
the string, or that which precedes a newline.

With the MULTILINE flag, $ matches before *any* newline?

Is this correct?

> Kent

S.
_______________________________________________
Tutor maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/tutor

Reply via email to