grthtrhthjhtyjytjytkergtrhtrjytjerhrfh4:24 29/09/2026o ®û|jô=ã@s„dZddlZddlZddlZddlZzddlZWn ey#dZYnwgd¢ZdZGdd„dej ƒZ e ƒ  e j ¡ejZd0dd„Zd0d d „Zd0d d „Zd1d d„Zd1dd„Zd1dd„Zd0dd„Zd0dd„Zd0dd„Zdd„Zd0dd„Zdd„dDƒZd d!„Zee d"d¡ƒZee d"d¡ d"¡ƒZiZd#Z d$d%„Z!e "e ¡d&d'„ƒZ#d(d)„Z$d*d+„Z%ddl&Z&d,d-„Z'e& (ee'e!¡Gd.d/„d/ƒZ)dS)2aÕSupport for regular expressions (RE). This module provides regular expression matching operations similar to those found in Perl. It supports both 8-bit and Unicode strings; both the pattern and the strings being processed can contain null bytes and characters outside the US ASCII range. Regular expressions can contain both special and ordinary characters. Most ordinary characters, like "A", "a", or "0", are the simplest regular expressions; they simply match themselves. You can concatenate ordinary characters, so last matches the string 'last'. The special characters are: "." Matches any character except a newline. "^" Matches the start of the string. "$" Matches the end of the string or just before the newline at the end of the string. "*" Matches 0 or more (greedy) repetitions of the preceding RE. Greedy means that it will match as many repetitions as possible. "+" Matches 1 or more (greedy) repetitions of the preceding RE. "?" Matches 0 or 1 (greedy) of the preceding RE. *?,+?,?? Non-greedy versions of the previous three special characters. {m,n} Matches from m to n repetitions of the preceding RE. {m,n}? Non-greedy version of the above. "\\" Either escapes special characters or signals a special sequence. [] Indicates a set of characters. A "^" as the first character indicates a complementing set. "|" A|B, creates an RE that will match either A or B. (...) Matches the RE inside the parentheses. The contents can be retrieved or matched later in the string. (?aiLmsux) The letters set the corresponding flags defined below. (?:...) Non-grouping version of regular parentheses. (?P...) The substring matched by the group is accessible by name. (?P=name) Matches the text matched earlier by the group named name. (?#...) A comment; ignored. (?=...) Matches if ... matches next, but doesn't consume the string. (?!...) Matches if ... doesn't match next. (?<=...) Matches if preceded by ... (must be fixed length). (? sr[s()[]{}?*+-|^$\.&~# cCs.t|tƒr | t¡St|dƒ}| t¡ d¡S)z0 Escape special characters in a string. Úlatin1)Ú isinstanceÚstrÚ translateÚ_special_chars_mapÚencode)rIr1r1r2r s   r Úic CsÆt|tƒr|j}z tt|ƒ||fWStyYnwt|tƒr)|r'tdƒ‚|St  |¡s2t dƒ‚t  ||¡}|t @sat tƒtkrXz ttttƒƒ=Wn tttfyWYnw|tt|ƒ||f<|S)Nz5cannot process flags argument with a compiled patternz1first argument must be string or compiled pattern)r]rr,rSÚtypeÚKeyErrorrÚ ValueErrorr7ÚisstringÚ TypeErrorr rCr*Ú _MAXCACHEÚnextÚiterÚ StopIterationÚ RuntimeError)rIrKÚpr1r1r2rG s2  ÿ ÿ   ÿrGcCs t ||¡S©N)Ú sre_parseÚparse_template)rOrIr1r1r2rU:s rUcCst ||¡}t ||¡Srn)rorpÚexpand_template)rIrr r1r1r2Ú_expand?s  rrcCs>t||ƒ}|dst|dƒdkr|ddS|fdd„}|S)Nrr!cSs t ||¡Srn)rorq)rr r1r1r2ÚfilterJs z_subx..filter)rUr*)rIr rsr1r1r2Ú_subxDs   rtcCst|j|jffSrn)rGrIrK)rmr1r1r2Ú_pickleRsruc@seZdZddd„Zdd„ZdS)ÚScannerrc Cs¬ddlm}m}t|tƒr|j}||_g}t ¡}||_ |D]$\}}|  ¡} |  t  ||| ddt  ||¡ffg¡¡| | |d¡qt  ||d|ffg¡}t |¡|_dS)Nr)ÚBRANCHÚ SUBPATTERNéÿÿÿÿ)Ú sre_constantsrwrxr]rr,ÚlexiconroÚStaterKÚ opengroupr'Ú SubPatternÚparseÚ closegroupr7r Úscanner) r+r{rKrwrxrmÚsÚphraseÚactionÚgidr1r1r2Ú__init__[s   ÿzScanner.__init__c Cs’g}|j}|j |¡j}d} |ƒ}|sn,| ¡}||krn#|j|jdd}t|ƒr6||_||| ¡ƒ}|dur>||ƒ|}q|||d…fS)NrTr!)r'r�rÚendr{Ú lastindexÚcallableÚgroup) r+rJÚresultr'rrZr/Újr„r1r1r2Úscanls(óz Scanner.scanN©r)r4r5r6r†r�r1r1r1r2rvZs  rvrŽ)rr)*Ú__doc__Úenumr7roÚ functoolsÚ_localeÚ ImportErrorÚ__all__Ú __version__ÚIntFlagrÚglobalsÚupdateÚ __members__rrrrrrrrr r r r r`r rcrrrSrhrGÚ lru_cacherUrrrtÚcopyregruÚpicklervr1r1r1r2ÚsRk  ÿ"