(-: Sorry about Tim. He's not very imaginative. He presumed that because you asked on comp.lang.python that you would be testing it with Python. You should have either (a) asked your question on comp.toolswithfunnynames.grep or (b) not presumed that grep's re syntax is the same as Python's. :-)
My grep appears to need something fugly like this: grep -e "\(and\|or\|xor\)[ \t]*#" grepre.txt but my grep is a Windows port which identifies itself as "grep (GNU grep) 2.5.1" so it's definitely not The One True Grep ... Now that you're here, why don't you try Python? It's not hard, e.g. #>>> import re #>>> rs = re.compile(r"(and|or|xor)\s*#").search #>>> rs("if foo and #continued") #<_sre.SRE_Match object at 0x00AE66E0> #>>> rs("if foo and#continued") #<_sre.SRE_Match object at 0x00AE6620> #>>> rs("if foo and bar #continued") #>>> rs("if foo xor # continued") #<_sre.SRE_Match object at 0x00AE66E0> #>>> HTH, John -- http://mail.python.org/mailman/listinfo/python-list