| Server IP : 46.17.175.229 / Your IP : 216.73.216.146 Web Server : LiteSpeed System : Linux lt-bnk-web1163.main-hosting.eu 4.18.0-553.109.1.lve.el8.x86_64 #1 SMP Thu Mar 5 20:23:46 UTC 2026 x86_64 User : u528038015 ( 528038015) PHP Version : 8.2.33 Disable Function : system, exec, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail MySQL : OFF | cURL : ON | WGET : ON | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /opt/alt/python37/lib/python3.7/site-packages/validators/__pycache__/ |
Upload File : |
B
d�me% � @ s8 d dl Z ddlmZ e �d�Zddd�Zed d
� �ZdS )� N� )� validatorz]^(?:[a-zA-Z0-9](?:[a-zA-Z0-9-_]{0,61}[A-Za-z0-9])?\.)+[A-Za-z0-9][A-Za-z0-9-_]{0,61}[A-Za-z]$�utf-8�strictc C s* | d krd S t | t�st| �S | �||�S )N)�
isinstance�bytes�str�decode)�obj�charset�errors� r
�B/opt/alt/python37/lib/python3.7/site-packages/validators/domain.py�
to_unicode
s
r c C s8 yt �t| ��d��d��S ttfk
r2 dS X dS )af
Return whether or not given value is a valid domain.
If the value is valid domain name this function returns ``True``, otherwise
:class:`~validators.utils.ValidationFailure`.
Examples::
>>> domain('example.com')
True
>>> domain('example.com/')
ValidationFailure(func=domain, ...)
Supports IDN domains as well::
>>> domain('xn----gtbspbbmkef.xn--p1ai')
True
.. versionadded:: 0.9
.. versionchanged:: 0.10
Added support for internationalized domain name (IDN) validation.
:param value: domain string to validate
�idna�asciiFN)�pattern�matchr �encoder �UnicodeError�AttributeError)�valuer
r
r �domain s r )r r )�re�utilsr �compiler r r r
r
r
r �<module> s