src.pydasa.validations.patterns#

Regex patterns for validation and parsing in PyDASA.

Contains:
  • LaTeX validation patterns

  • FDU (Fundamental Dimensional Unit) matching patterns

  • Default and working pattern sets for dimensional analysis

Attributes#

LATEX_RE

LaTeX regex pattern to match LaTeX symbols (e.g., 'alpha', 'beta_{1}') in PyDASA.

DFLT_POW_RE

Default regex to match FDUs with exponents (e.g., 'M*L^-1*T^-2' to 'M^(1)*L^(-1)*T^(-2)').

PI_COEF_RE

Regex pattern to match dimensionless coefficients in PyDASA (e.g, 'Pi_{1}', 'Pi_{2}').

PI_POW_RE

Regex pattern to match dimensionless coefficients with power operations in PyDASA (e.g., 'Pi_{1}**(-2)').

NUM_CONST_RE

Regex pattern to match numeric constants (e.g., '3.14', '-2.5e3') in PyDASA.

BASIC_OPS_RE

Regex pattern to split expressions by basic operations (, /, ^, +, -) in *PyDASA.

IGNORE_EXPR

Set of LaTeX expressions to ignore during parsing in PyDASA.

Module Contents#

src.pydasa.validations.patterns.LATEX_RE: str = '\\\\?[a-zA-Z]+(?:_\\{\\d+\\})?'#

LaTeX regex pattern to match LaTeX symbols (e.g., ‘alpha’, ‘beta_{1}’) in PyDASA.

src.pydasa.validations.patterns.DFLT_POW_RE: str = '\\-?\\d+'#

Default regex to match FDUs with exponents (e.g., ‘M*L^-1*T^-2’ to ‘M^(1)*L^(-1)*T^(-2)’).

src.pydasa.validations.patterns.PI_COEF_RE: str = '\\\\Pi_\\{\\d+\\}'#

Regex pattern to match dimensionless coefficients in PyDASA (e.g, ‘Pi_{1}’, ‘Pi_{2}’).

src.pydasa.validations.patterns.PI_POW_RE: str = '(\\\\Pi_\\{\\d+\\})\\s*\\*\\*\\s*\\(([^)]+)\\)'#

Regex pattern to match dimensionless coefficients with power operations in PyDASA (e.g., ‘Pi_{1}**(-2)’).

src.pydasa.validations.patterns.NUM_CONST_RE: str = '^[-+]?\\d*\\.?\\d+(?:[eE][-+]?\\d+)?$'#

Regex pattern to match numeric constants (e.g., ‘3.14’, ‘-2.5e3’) in PyDASA.

src.pydasa.validations.patterns.BASIC_OPS_RE = '(\\*|\\/|\\+|\\-|\\^)'#

Regex pattern to split expressions by basic operations (, /, ^, +, -) in *PyDASA.

src.pydasa.validations.patterns.IGNORE_EXPR#

Set of LaTeX expressions to ignore during parsing in PyDASA.