bskinn / pent

pent Extracts Numerical Text -- Mini-language driven parser for structured numerical data in text
MIT License
20 stars 3 forks source link

Convert head/body/tail to @properties with .setter() #38

Open bskinn opened 6 years ago

bskinn commented 6 years ago

Since the regex is deterministic from the patterns/Patterns, it might as well be compiled once, at whatever time the properties are set.

Can then return the string or pattern object from the property, from a private var, and the generated regex pattern strings could also be stored in various ways, internally.

bskinn commented 6 years ago

However: Since the regex pattern compilation at this point has two flags that change the capture-group insertion behavior, pre-compilation of the patterns may be more convoluted than would be useful.