so i've basically got a code file with comments where i want to remove the comments using a regular expression. the comments are identified with /* and */, which can span multiple lines. the final solution from a prior post was to use:
unfortunately, the result from this removes all new line characters in the code file. i'm not sure if this is an issue with powershell. i tried this pattern on a regexp test web site (non-powershell code) and the results it provided retained new line characters for non-comment sections. any thoughts?
thanks,
glenn
Code:
[Regex]::Replace("/\*.*?\*/","")
unfortunately, the result from this removes all new line characters in the code file. i'm not sure if this is an issue with powershell. i tried this pattern on a regexp test web site (non-powershell code) and the results it provided retained new line characters for non-comment sections. any thoughts?
thanks,
glenn