Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes15kdownloads
regexopt.cpython-313.pyc36 linesDownload Raw Back to __pycache__
1�

2�j����SrSSKrSSKJr SSKJr SSKJr \R"S5r\"S5r	Sr3SrS	rSS4jr
g)z�5pygments.regexopt6~~~~~~~~~~~~~~~~~7 8An algorithm that generates optimized regexes for matching long lists of9literal strings.10 11:copyright: Copyright 2006-present by the Pygments team, see AUTHORS.12:license: BSD, see LICENSE for details.13�N)�escape)�groupby)�14itemgetterz[\[\^\\\-\]]c��U(dg[U5n[U5n[U5Hup4XBU:wdMUSUs $ U$)zJGiven an iterable of strings, returns the longest common leading substring�N)�min�max�	enumerate)�m�s1�s2�i�cs     �WD:\code\apps\devtools\python\user_packages\Python313\site-packages\pygments/regexopt.py�commonprefixrsE����	�Q��B�	�Q��B��"�
����1��:��b�q�6�M���I�c�Z�S[RSSRU55-S-$)N�[c�(�SUR5-$)N�\)�group)rs r�<lambda>�make_charset.<locals>.<lambda>"s������	�)9rr�])�	CS_ESCAPE�sub�join)�letterss r�make_charsetr!s'������9�2�7�7�7�;K�L�L�s�R�Rrc	��^15^�U=(a S=(d SnU(dgUSm16[U5S:XaU[T175-U-$T18(dU[USSS5-S-U-$[T195S:Xa�/n/nUH6n[U5S:XaURU5 M%URU5 M8 [U5S:�a9U(a!U[US5-S-[	U5-U-$U[	U5-U-$[U5nU(a<[U5nU[U5-[UVs/sHoUUSPM	 snS5-U-$UVs/sH20oUSSS	2PM nn[U5n	U	(aB[U	5mU[[
U4S21jU55S5-[U	SSS	25-U-$USRS[UU224Sj555-U-$s snfs snf)
zEReturn a regex that matches any string in the sorted list of strings.�)rr�Nz(?:�?�|�����c3�.># �UH23oST*v� M g7f)N�)�.0�s�slens  �r�	<genexpr>�"regex_opt_inner.<locals>.<genexpr>Ss����$@��1�v���Y��s�c3�R# �UHn[[US5S5v� M g7f)r"rN)�regex_opt_inner�list)r(rs  rr+r,Xs*���L�J�U�!��e�A�h���4�4�J�s�%'c�>�USTS:H$)Nrr')r)�firsts �rr�!regex_opt_inner.<locals>.<lambda>Ys����1���q��9Ir)	�lenrr.�appendrr�sortedrr)�strings�24open_paren�close_paren�	oneletter�restr)�prefix�plen�strings_rev�suffixr1r*s          @@rr.r.%s����$��*��K����A�J�E�25�7�|�q���F�5�M�)�K�7�7���O�G�A�B�K��?�?���� �	 �26�5�z�Q���	����A��1�v��{�� � ��#����A��	�27�y�>�A���!�O�D�"�$=�=��C�"�9�-�.�0;�<�<���Y� 7�7�+�E�E�
�'�
"�F�
��6�{���F�6�N�*���9��A���x��9�5�A�B���	�%,�,�G�q�T�r�T�7�G�K�,�
�+�
&�F�
��6�{����f�$@��$@�@�%�H�I��V�D�b�D�\�"�#�%0�1�	1�28����L�%�g�/I�J�L�	L�L�����:��-s�-G29�G$c�<�[U5nU[US5-U-$)z�Return a compiled regex that matches any string in the given list.30 31The strings to match must be literal strings, not regexes.  They will be32regex-escaped.33 34*prefix* and *suffix* are pre- and appended to the final regex.35�()r5r.)r6r;r>s   r�	regex_optrA]s$���W�o�G��O�G�S�1�1�F�:�:r)rr)�__doc__�rer�	itertoolsr�operatorr�compiler�
FIRST_ELEMENTrrr.rAr'rr�<module>rHsE��	�36�����J�J��'�	��1�
�
�	�S�5�p	;r
codekingpro/portable-devtools · Team Ai