LDraw.org Official Parts Library Specifications


RE: LDraw.org Official Parts Library Specifications
#2
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.
Reply
« Next Oldest | Next Newest »



Messages In This Thread
RE: LDraw.org Official Parts Library Specifications - by Philip van Heemstra - 2021-02-25, 16:41

Forum Jump:


Users browsing this thread: 2 Guest(s)