���� ������������������������������������  fc@sRdZddlTddlZdddYZdZedkrNendS( sDBasic regular expression demonstration facility (Perl style syntax).i(t*NtReDemocBs;eZdZdZdZddZddZRS(c Cs||_t|jdtdd|_|jjdtdtt|j|_|jjdt|jj |j t|jdddt|_ |j jdtdtt|jdtdd|_ |j jdt|j jdtt ||_|jjdtdtt||_|jjdt|jdd d |jd dd |j|_|jjdtt|jdd d |jd dd |j|_|jjdtt|jdddd|_|jjdtdd|jjdddt|jdddt|_|jjdtt|j|_|jjdddt|jjd|j|jjd|jd|_!|j|jj"}|jj"|d|d |jj"}|jj"|d|d dS(Ntanchorttexts&Enter a Perl-style regular expression:tsidetfilltsEnter a string to search:tfirstsHighlight first matchtvariabletvaluetcommandsHighlight all matchestalltwidthi<theightitexpandithitt backgroundtyellowsGroups:s(#tmastertLabeltWt promptdisplaytpacktTOPtXtEntryt regexdisplayt focus_sett addoptionst statusdisplayt labeldisplaytFramet showframet StringVartshowvartsett Radiobuttont recompiletshowfirstradiotLEFTt showallradiotTextt stringdisplaytBOTHt tag_configuret grouplabeltListboxt grouplisttbindt reevaluatetNonetcompiledtbindtags(tselfRtbtags((s,/usr/lib64/python2.7/Tools/scripts/redemo.pyt__init__ sZ           c Csg|_g|_g|_xdD]}t|jddkrst|j}|jdt|jj|nt t |}t }t |d |d |d dd |d |j }|jdt|jj||jj|q"WdS(Nt IGNORECASEtLOCALEt MULTILINEtDOTALLtVERBOSEiiRRRtoffvaluetonvalueR R(R8R9R:R;R<(tframestboxestvarstlenRRRRtappendtgetattrtretIntVart CheckbuttonR%R'(R5tnametframetvaltvartbox((s,/usr/lib64/python2.7/Tools/scripts/redemo.pyRHs*         cCs4d}x!|jD]}||jB}qW|}|S(Ni(RAtget(R5tflagsRK((s,/usr/lib64/python2.7/Tools/scripts/redemo.pytgetflags_s cCsyNtj|jj|j|_|jd}|jjddd|WnBtj k r}d|_|jjddt |ddnX|j dS(NRRRs re.error: %stred( REtcompileRRMROR3RRtconfigterrorR2tstrR1(R5teventtbgtmsg((s,/usr/lib64/python2.7/Tools/scripts/redemo.pyR%fs    c CsUy|jjddtWntk r-nXy|jjddtWntk r[nX|jjdt|js|dS|jjddd|jjddd|jjdt}d}d}xJ|t |kr|jj ||}|dkrPn|j \}}||kr4|d}d}nd}d |}d |} |jj ||| |dkr|jj|t|j} | jd|jxDtt | D]-} d | | | f} |jjt| qWn|d}|jjd krPqqW|dkr>|jjd d ddn|jjd ddS(NRs1.0thit0iRRtorangeis1.0 + %d charss%2d: %rRRs (no match)R(R*t tag_removetENDtTclErrorR/tdeleteR3R,RMRBtsearchR2tspanttag_addtyview_pickplacetlisttgroupstinserttgrouptrangeR"RRR( R5RURtlasttnmatchestmRttagtpfirsttplastRctitg((s,/usr/lib64/python2.7/Tools/scripts/redemo.pyR1ssT             N(t__name__t __module__R7RROR2R%R1(((s,/usr/lib64/python2.7/Tools/scripts/redemo.pyRs  ?   cCs6t}t|}|jd|j|jdS(NtWM_DELETE_WINDOW(tTkRtprotocoltquittmainloop(troottdemo((s,/usr/lib64/python2.7/Tools/scripts/redemo.pytmains  t__main__((t__doc__tTkinterRERRxRo(((s,/usr/lib64/python2.7/Tools/scripts/redemo.pyts