Syntax rules:
Number format rules:
See reference: LDraw File Format Specification
What it does and what it's used for
This regex matches every integer and float (excluding "e" notations). All invalid and/or unpreferred formats will be captured in groups 1 through 6. These groups will contain the invalid parts of a number.
Some might have multiple format errors, but only one will be captured. See comments in Test string
for which group captures what error.
Group 0 contains the entire number including any possible invalid parts.
This regex was created for us as an syntax highlighter for LDraw files in Sublime Text 3.
License This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.