Exemple :
a = "bzzzzzz <!-- blabla --> blibli * bloblo * blublu"
I want to catch the first comment. A comment may be
(<!-- .* -->) or (\* .* \*)
That is ok :
re.search("<!--(?P<comment> .* )-->",a).group(1)
Also that :
re.search("\*(?P<comment> .* )\*",a).group(1)
But if i want one or the other in comment, i have tried something like :
re.search("(<!--(?P<comment> .* )-->|\*(?P<comment> .* )\*)",a).group(1)
But it does't work
Thanks
<!-- first comment --> real material <!-- second comment -->.