Thanks. Unfortunately, that was just a typo made while editing the post. The original code already had it in there. I did find that using quotes instead of apostrophes made a difference though. So this now works:
That doesn't create any erros and when I look at the source, the $condition appears exactly as when I type it in directly but the match isn't found. Does anyone have any suggestions on what might make this fail?