Your IP : 18.191.28.200
�
��bg�2 � � � d dl T d dlmZmZmZ ddlmZ G d� d� � Zd� ee� � � � � D � � Z dS ) � )�*)�delimited_list�any_open_tag�
any_close_tag� )�datetimec �
� e Zd ZdZ ee� � Z ee� � Z e e
� � � d� � � e� � Z
e e� � � d� � � eed� � � � Z ed� � � d� � � e� � Z e� � � e� � dz e� � � e� � z � d� � Z e� d � � � ee e ed
� � � � � ez � � z z � d� � Z e� e� � ed� � � d
� � � e� � Z ed� � � d� � � e� � Z eez ez � d� � � � � Z ed� � � d� � � e� � Z e ee� � � d� � Z ed� � � d� � Z! ed� � � d� � Z"e"de"z dz z � d� � Z# ee"de"z dz z � � dz ee"de"z dz z � � z � d� � Z$e$�% d� � � de!z � d � � Z& e'e#e&z e$z � d!� � � � � d!� � Z( ed"� � � d#� � Z) e*d?d%e+fd&�� � Z,e*d@d%e+fd(�� � Z- ed)� � � d*� � Z. ed+� � � d,� � Z/ ed-� � � d.� � Z0 e1j � � e2j � � z Z3e*d/e+d0ed1e4fd2�� � Z5 e' e6 e7d3� � e8� � z e e9d3�4� � z e e:d5� � e; e8� � d3z � � z � � z � � � � � � � � d6� � Z< e= ee>�? � � e<z d7�8� � � � � d9� � Z@ e* ed:� � � � � ZA e* ed;� � � � � ZB ed<� � � d=� � ZCeZDeZEe,ZFe-ZGe5ZHeAZIeBZJd>S )A�pyparsing_commona" Here are some common low-level expressions that may be useful in
jump-starting parser development:
- numeric forms (:class:`integers<integer>`, :class:`reals<real>`,
:class:`scientific notation<sci_real>`)
- common :class:`programming identifiers<identifier>`
- network addresses (:class:`MAC<mac_address>`,
:class:`IPv4<ipv4_address>`, :class:`IPv6<ipv6_address>`)
- ISO8601 :class:`dates<iso8601_date>` and
:class:`datetime<iso8601_datetime>`
- :class:`UUID<uuid>`
- :class:`comma-separated list<comma_separated_list>`
- :class:`url`
Parse actions:
- :class:`convertToInteger`
- :class:`convertToFloat`
- :class:`convertToDate`
- :class:`convertToDatetime`
- :class:`stripHTMLTags`
- :class:`upcaseTokens`
- :class:`downcaseTokens`
Example::
pyparsing_common.number.runTests('''
# any int or real number, returned as the appropriate type
100
-100
+100
3.14159
6.02e23
1e-12
''')
pyparsing_common.fnumber.runTests('''
# any int or real number, returned as float
100
-100
+100
3.14159
6.02e23
1e-12
''')
pyparsing_common.hex_integer.runTests('''
# hex numbers
100
FF
''')
pyparsing_common.fraction.runTests('''
# fractions
1/2
-3/4
''')
pyparsing_common.mixed_integer.runTests('''
# mixed fractions
1
1/2
-3/4
1-3/4
''')
import uuid
pyparsing_common.uuid.setParseAction(tokenMap(uuid.UUID))
pyparsing_common.uuid.runTests('''
# uuid
12345678-1234-5678-1234-567812345678
''')
prints::
# any int or real number, returned as the appropriate type
100
[100]
-100
[-100]
+100
[100]
3.14159
[3.14159]
6.02e23
[6.02e+23]
1e-12
[1e-12]
# any int or real number, returned as float
100
[100.0]
-100
[-100.0]
+100
[100.0]
3.14159
[3.14159]
6.02e23
[6.02e+23]
1e-12
[1e-12]
# hex numbers
100
[256]
FF
[255]
# fractions
1/2
[0.5]
-3/4
[-0.75]
# mixed fractions
1
[1]
1/2
[0.5]
-3/4
[-0.75]
1-3/4
[1.75]
# uuid
12345678-1234-5678-1234-567812345678
[UUID('12345678-1234-5678-1234-567812345678')]
�integerzhex integer� z[+-]?\d+zsigned integer�/�fractionc �$ � | d | d z S )Nr ���� )�tts �a/builddir/build/BUILD/cloudlinux-venv-1.0.7/venv/lib/python3.11/site-packages/pyparsing/common.py�<lambda>zpyparsing_common.<lambda>� s � ��A���B��� � �-z"fraction or mixed integer-fractionz[+-]?(?:\d+\.\d*|\.\d+)zreal numberz@[+-]?(?:\d+(?:[eE][+-]?\d+)|(?:\d+\.\d*|\.\d+)(?:[eE][+-]?\d+)?)z$real number with scientific notation�numberz[+-]?\d+\.?\d*([eE][+-]?\d+)?�fnumber�
identifierzK(25[0-5]|2[0-4][0-9]|1?[0-9]{1,2})(\.(25[0-5]|2[0-4][0-9]|1?[0-9]{1,2})){3}zIPv4 addressz[0-9a-fA-F]{1,4}�hex_integer�:� zfull IPv6 address)r � z::zshort IPv6 addressc �<