o
    ­ƒðjÓ  ã                   @   sz   U d Z ddlZddlmZ ddlmZmZ ddlmZ e 	dej
¡Zeed< d	ed
dfdd„Zdd	eded
efdd„ZdS )zA
.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>
é    N)ÚFinalé   )Úto_strÚvalidate_pathtype)ÚInvalidCharErrorz[^0-9A-Za-z_.-]Ú__RE_INVALID_LTSV_LABELÚlabelÚreturnc                 C   s0   t | dd� t t| ƒ¡}|rtd|› �ƒ‚dS )a  
    Verifying whether ``label`` is a valid
    `Labeled Tab-separated Values (LTSV) <http://ltsv.org/>`__ label or not.

    :param label: Label to validate.
    :raises pathvalidate.ValidationError:
        If invalid character(s) found in the ``label`` for a LTSV format label.
    F©Úallow_whitespacesz1invalid character found for a LTSV format label: N)r   r   Úfindallr   r   )r   Ú
match_list© r   ú”/tmp/claude-1000/-var-www-html-academy/3f42efd1-c2b7-4d08-9b05-30d86bb35479/scratchpad/piper/venv/lib/python3.10/site-packages/pathvalidate/_ltsv.pyÚvalidate_ltsv_label   s
   
ÿr   Ú Úreplacement_textc                 C   s   t | dd� t |t| ƒ¡S )z®
    Replace all of the symbols in text.

    :param label: Input text.
    :param replacement_text: Replacement text.
    :return: A replacement string.
    :rtype: str
    Fr
   )r   r   Úsubr   )r   r   r   r   r   Úsanitize_ltsv_label    s   
r   )r   )Ú__doc__ÚreÚtypingr   Ú_commonr   r   Úerrorr   ÚcompileÚUNICODEr   Ú__annotations__Ústrr   r   r   r   r   r   Ú<module>   s    