Problems with regular expressions

  • Thread starter =?iso-8859-1?Q?Carlos_Luis_P=E9rez_Alonso?=
  • Start date
?

=?iso-8859-1?Q?Carlos_Luis_P=E9rez_Alonso?=

I have the next piece of code:

------------------------------------------------------------------------
if re.search('^(taskid|bugid):\\d+',logMessage):
return 0
else:
sys.stderr.write("El comentario tiene que contener el taskid:#### o el bugid:####")
return 1
-------------------------------------------------------------------------

The regular exprexión is "^(taskid|bugid):\\d+"

Mi problem is that if logMessage == "taskid:234" the regular expression matched teorically, but the result is always "None" and the function returns 1.

¿Does anybody has an idea of what is happening here?

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,779
Messages
2,569,606
Members
45,239
Latest member
Alex Young

Latest Threads

Top