Using Regex to remove css comments

后端 未结 4 1040
执念已碎
执念已碎 2021-01-23 16:56

How can I remove comments from CSS using Regex.Replace()?

Note - I\'m not able to use the regex mentioned here in C# - Regular expression to remove CSS comm

4条回答
  •  佛祖请我去吃肉
    2021-01-23 17:29

    Very late reply but thought it will be useful for some

    "(?:/*(.|[\r\n])?/)|(?:(?([^)])//.)"

    This will help removing css comments both singleline and multiline.
    

提交回复
热议问题