bskinn / pent

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

How to implement repeated patterns (numerical vs string) as re inserting internal spaces #24

Closed bskinn closed 6 years ago

bskinn commented 6 years ago

Per the testing that closes #11 and #12, and as to be documented via #23, conjoining numbers without whitespace will almost certainly not work correctly/reliably. Thus, re patterns for repeated numbers should always insert gapping whitespace, regardless of the .space_after of the token or the one preceding it.

However, repeated string literals probably should be directly concatenated, without inserting whitespace between each, since any needed whitespace can be supplied by the user as part of the literal...as long as it's consistent in size. Even if it's not consistent, suitable use of 'any' captures should allow matching of a LOT of text patterns.

SEE ALSO #27