On 9/1/10 2:41 PM, Ken Kixmoeller f/h wrote: > That was it. Many thanks for helping me understand. Since the examples I > "google-mined" had the negation (!), I got it in my head that the > .search with RegEx would return a True or False value.
I never remember regex syntax. I always have to refresh my memory and so whenever I'm faced with a new regex problem, one of the first things I do is start a new Python script with a skeleton function and a test case against that function to make sure defined given inputs produce the desired outputs. Of course all the tests fail at this point. Then I find a regex cheat sheet online and start hacking. Once all my tests pass I'm probably done (perhaps I need to think of some outlyer cases just to be sure, though). Usually takes less than 30 minutes start to finish, and I save all such one-off test programs to source control, after putting relevant keywords in the function docstring and script comments, to grep for and refer to in the future. Sorry I was lazy and directed you to google instead of trying to sort it out for you. As usual, I'm glad Ed stepped up! Paul _______________________________________________ Post Messages to: [email protected] Subscription Maintenance: http://leafe.com/mailman/listinfo/profox OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech Searchable Archive: http://leafe.com/archives/search/profox This message: http://leafe.com/archives/byMID/profox/[email protected] ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

