Notifications
Clear all
[Closed] MAXScript find and remove specified string from text file
Jan 21, 2021 5:21 pm
How to remove all the text between the characters /* and */ (including these characters as well) in a text file? I need this to clear the code text of any comment lines. Thank you.
2 Replies
Jan 21, 2021 5:21 pm
you can use these patterns combined with (dotNetClass “System.Text.RegularExpressions.RegEx”).Replace to remove the comments
local block_comment = "\/\*(\*(?!\/)|[^*])*\*\/\r*\n*"
local line_comment = "(--[^\r\n]*\r*\n*)"