RegExp question

Ben C spamspam at spam.eggs
Tue Apr 11 15:40:52 EDT 2006


On 2006-04-11, Michael McGarry <michael.mcgarry at gmail.com> wrote:
> Hi,
>
> 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?

    re.compile(r'(?:and|or|xor)\s*#')



More information about the Python-list mailing list