"Kevin CH" wrote:

news:[EMAIL PROTECTED]
> Thank you for your reply.
>
> > Perhaps you are using grep, or you have stumbled on the old deprecated
> > "regex" module and are using that instead of the "re" module. Perhaps
> > not as you are using only 2 plain vanilla RE operations which should
> > work the same way everywhere. Perhaps you are having trouble with
> > search() versus match() -- if so, read the section on this topic in the
> > re docs. It's rather hard to tell what you are doing without seeing the
> > code you are using.
>
> Sorry I should have said it up front.  I'm using Kudos (which I'm sure
> uses re module) to test these strings on the pattern, and had the match
> results as I stated.  (search() of course gives me true since the
> pattern appears in the substrings of both strings.)

Python's "match" function doesn't return "true" or "false"; it returns a match
object if the string matches the pattern, and None if not.  since your pattern
can match the empty string, it'll match any target string (all strings start 
with
an empty string), and will never return false.

looks like the "debugger" does a great job of hiding how things really work...

</F>



-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to