
re bug, or am I missing something?
[Soren Ragsdale]
Quote:
> ...
> I'm very new to Python, so perhaps this will become clearer with time,
> but why is it necessary to have two "use this regular expression on
> this string" methods? It seems to me that you could use
> re.search("^(pattern)")
> and get re.match()-like behavior.
There is no general way to spell what "match" can do using "search". When
you start crunching huge strings in pieces with the optional "starting
position" argument, you'll quickly find that a leading "^" doesn't mean
"match starting here" -- "^" still means "start of the buffer or immediately
following a newline", which is not at all what you'll need. Even for a
single search, "^" may not mean "start of buffer", depending on single-line
vs multi-line mode. match does exactly what you need with no hassles in
such cases.
Quote:
> OTOH, criticizing a language I've just recently started learning
> seems about as couth as showing up to a party and immediately
> questioning the choice of music or hors d'oeuvres. I shall be
> quiet now.
Too late! We already booted you out the door, and won't let you back in
until you have something effusively nice to say. Note that sincerity is not
required, however -- your next post just has to suck up a *little* <wink>.
python's-house-mother-ly y'rs - tim