> I would like to form a regular expression to find a few
> different tokens (and, or, xor) followed by some variable
> number of whitespace (i.e., tabs and spaces) followed by
> a hash mark (i.e., #). What would be the regular
> expression for this?


        (and|or|xor)\s*#

Unless "varible number of whitespace" means "at least *some* 
whitespace", in which case you'd want to use

        (and|or|xor)\s+#

Both are beautiful and precise.

-tim




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

Reply via email to