povray:
regexp to clean the code using notepad++

Another regular expression to clean povray code with notepad++, replacing color formats “red num green num blue num” to “rgb<num,num,num>”. In the text field Find what: copy and paste the expression:
(red\s*)([0-9]*.{0,1}[0-9]*)(\s*green\s*)([0-9]*.{0,1}[0-9]*)(\s*blue\s*)([0-9]*.{0,1}[0-9]*)
And in Replace with::
rgb<\2,\4,\6>
Pressing Replace All clean it the code making it more compact and readable

Leave a Reply

Your email address will not be published. Required fields are marked *