# AUTOGENERATED! DO NOT EDIT! File to edit: ../nbs/04_pttn.ipynb.

# %% auto 0
__all__ = ['ftmpl', 'btmpl', 'etmpl', 'fpttn', 'bpttn', 'epttn']

# %% ../nbs/04_pttn.ipynb 3
import re
from string import Template

# %% ../nbs/04_pttn.ipynb 4
from .cons import e, F, SCHRS, SSYMS, ECHRS

# %% ../nbs/04_pttn.ipynb 7
ftmpl = Template(f'{F}$expo$sign')
btmpl = Template(f'$base$echr$sign$expo')
etmpl = Template(f'{e}$sign$expo')

# %% ../nbs/04_pttn.ipynb 9
fpttn = re.compile(rf'{F}(?P<expo>\d+)(?P<sign>[{re.escape(SCHRS)}]?)')
bpttn = re.compile(rf'(?P<base>\d*)\s*[{re.escape(ECHRS)}]\s*(?P<sign>[{re.escape(SSYMS)}]?)(?P<expo>\d+)')
epttn = re.compile(rf'{e}(?P<sign>[{re.escape(SSYMS)}]?)(?P<expo>\d+)')
