RE: LDraw.org Official Parts Library Specifications
2021-02-25, 16:41 (This post was last modified: 2021-02-26, 1:35 by Philip van Heemstra. Edit Reason: Updated url and information )
2021-02-25, 16:41 (This post was last modified: 2021-02-26, 1:35 by Philip van Heemstra. Edit Reason: Updated url and information )
For ease of use, I made a regex that matches only the valid numbers used in line commands inside LDraw files:
Regex to match the valid and preferred number formats inside a LDraw model file
This may be handy for syntax highlighting and/or validation. So, feel free to use/include it!
UPDATE:
- some minor fixes
- added capture groups for invalid formats (these can be used to inform what is wrong with a number format)
(If I missed any cases, please let me know!)
Note: This is used in my LDraw syntax highlighter for Sublime Text 3. For more info on that, see this thread.
Regex to match the valid and preferred number formats inside a LDraw model file
This may be handy for syntax highlighting and/or validation. So, feel free to use/include it!
UPDATE:
- some minor fixes
- added capture groups for invalid formats (these can be used to inform what is wrong with a number format)
(If I missed any cases, please let me know!)
Note: This is used in my LDraw syntax highlighter for Sublime Text 3. For more info on that, see this thread.