mò %U²Ic@sÀdZdkZeideƒeiddeeƒdkZddddd gZd „Zd „Z d d „Z d d„Z d„Z dd„Z had„Zd„Zd„Zd„ZdS(sRegexp-based split and replace using the obsolete regex module. This module is only for backward compatibility. These operations are now provided by the new regular expression module, "re". sub(pat, repl, str): replace first occurrence of pattern in string gsub(pat, repl, str): replace all occurrences of pattern in string split(str, pat, maxsplit): split string using pattern as delimiter splitx(str, pat, maxsplit): split string using pattern as delimiter plus return delimiters Ns4the regsub module is deprecated; please use re.sub()tignorettsubtgsubtsplittsplitxtcapwordscCset|ƒ}|i|ƒdjo?|i}|d\}}|| t|||ƒ||}n|S(Ni( tcompiletpattprogtsearchtstrtregstatbtexpandtrepl(RRR R RR R ((t#/data/zmath/lib/python2.4/regsub.pyRs   &c Cst|ƒ}d}d}d} xÜ|i||ƒdjoÂ|i}|d\}}||jo |jnoZ| oR|t |ƒjp|i||dƒdjoPn|i}|d\}}n||||!t |||ƒ}|}d} q!W|||}|S(NRii(RRR tnewtstarttfirstR R R R RtlenRR( RRR R RR RR RR((RR,s$  &0 ! icCst|||dƒS(Ni(tintsplitR Rtmaxsplit(R RR((RREscCst|||dƒS(Ni(RR RR(R RR((RROsc Cst|ƒ} g}d} }d} xÊ| i||ƒdjo°| i }|d\}}||jo&|d}|t |ƒjoPqêq%|i || |!ƒ|o|i |||!ƒn|} }| d} |o| |joPq%q%W|i || ƒ|S(Nii(RRR tresRtnextt splitcountR R R R RRtappendtretainR( R RRRR RRR RRR R((RRTs*         s[^a-zA-Z0-9_]+cCsSt||ƒ}x4tdt|ƒdƒD]}||iƒ|| iÿÿÿÿs isSorry, not three fieldsssplit:ssub :sgsub:(tsystargvtdelpattstdintisattytstderrtwritetreadlinetlineRtfieldsRtreprRRR RR(RR/R6R-RR R5((Rttest´s* (t__doc__twarningstwarntDeprecationWarningtfilterwarningst__name__R#t__all__RRRRRRR&RR'RR8( R#RRR?R:R'RRRRR8RR((Rt? s"