<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
--></style>
</head>
<body class='hmmessage'>
Hi, <BR>
First of all thanks a lot for your reply. "search.findall" is not working. here is my complete small program.<BR>
 <BR>
def getAcl(request, pg):<BR>    pged = PageEditor(request, pg)<BR>    pagetext = pged.get_raw_body()<BR>    search=re.compile("^#acl InternationalGroup.*\n", re.M).search(pagetext)<BR>    if search:<BR>        ret=search.group()<BR>    else:<BR>        ret='not defined'<BR>    return ret<BR>
<BR>def execute(macro, args):<BR>
    html="<p><b>ACL List For International Group:</b><br>"<BR>    all={}<BR>    pages = macro.request.rootpage.getPageList()<BR>    for pagename in pages:<BR>        if Page(macro.request,pagename).isStandardPage():<BR>            all[Page(macro.request, pagename).link_to(macro.request)]=getAcl(macro.request, pagename)<BR>
    html+="<table>"<BR>    all1=sorted(all.items())<BR>    for pg, ac in all1:<BR>        if ac != "not defined":<BR>            html+="<tr><td>%s</td>" % pg<BR>            html+="<td>%s</td></tr>" % ac<BR>    html+="</table>"<BR>    return macro.formatter.rawHTML(html)<BR><BR><BR>
<DIV> </DIV>
Now i explain this.<BR>
I have some wiki pages(or you can say documents). <BR>
This python program is giving me list of all those pages, where i have written "#acl InternationalGroup:read" line in the pages and these pages may have also "CatInternational" line in the page. <BR>
 <BR>
<BR>
Now i want to search all those pages, where i have <STRONG>NOT</STRONG> written "#acl InternationalGroup:read" <STRONG>But</STRONG>  i have written only "CatInternational" in the page text.<BR>
 <BR>
I dont know how can i find only those pages where i have written <STRONG>only</STRONG> "CatInternational" line in the page. <BR>
 <BR>
I shall be veryyyyyyyyyyyyyy thankful to you really for help. <BR>
 <BR>
Best Regards, <BR>
Waqas<BR>
 <BR>
 <BR>

<HR id=stopSpelling>
<BR>
Date: Fri, 25 Sep 2009 15:39:27 -0600<BR>Subject: Re: [Tutor] Help required<BR>From: vinces1979@gmail.com<BR>To: waqas805@hotmail.com<BR>CC: python-list@python.org; tutor@python.org<BR><BR><BR><BR><BR>
<DIV class=ecxgmail_quote>On Fri, Sep 25, 2009 at 1:56 PM, waqas ahmad <SPAN dir=ltr><<A href="mailto:waqas805@hotmail.com">waqas805@hotmail.com</A>></SPAN> wrote:<BR>
<BLOCKQUOTE style="PADDING-LEFT: 1ex" class=ecxgmail_quote>
<DIV><BR><BR>
<DIV> Hi, <BR> <BR>I dont know it is the right place to post this question. I need help to change one search code line . can you help me please.<BR> <BR>here is my search method code:<BR> <BR>search=re.compile("^#acl InternationalGroup.*\n", re.M).search(pagetext)<BR>    if search:<BR>        ret=search.group()<BR>    else:<BR>        ret='not defined'<BR>    return ret<BR>
<DIV> </DIV>
<DIV>here i am searching for "#acl InternationalGroup" in the pageText and when it true is then give me search group.</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>I want to change this for following requirement:</DIV>
<DIV> </DIV>
<DIV>I want to search  for "#acl InternationalGroup" and  "CatInternational" for both in the pageText.</DIV>
<DIV>when "#acl InternationalGroup" is not there but only "CatInternational" is there. then return me search group.</DIV><BR>I shall be thankful to you for any help.<BR> <BR>Best Regards, <BR>Waqas<BR></DIV><BR><BR><BR>
<HR>
What can you do with the new Windows Live? <A href="http://www.microsoft.com/windows/windowslive/default.aspx">Find out</A></DIV><BR>_______________________________________________<BR>Tutor maillist  -  <A href="mailto:Tutor@python.org">Tutor@python.org</A><BR>To unsubscribe or change subscription options:<BR><A href="http://mail.python.org/mailman/listinfo/tutor">http://mail.python.org/mailman/listinfo/tutor</A><BR><BR></BLOCKQUOTE></DIV><BR>i think this is what you are looking for:<BR><BR><BR><BR>search=re.compile("(#acl\sInternationalGroup|CatInternational).*\n", re.M).search(pagetext)<BR>if search:<BR>    ret=search.findall()<BR>else:<BR>    ret='not defined'<BR>return ret<BR><BR>                                           <br /><hr />See all the ways you can stay connected <a href='http://www.microsoft.com/windows/windowslive/default.aspx' target='_new'>to friends and family</a></body>
</html>