Match CSS and JS Comments


/ Published in: Regular Expression
Save to your folder(s)

Matches CSS-style comments spanning one or multiple lines


Copy this code and paste it in your HTML
  1. # This is how it would look using the Ruby Regexp class
  2.  
  3. # Only match one-line comments
  4. Regexp.new(/\/\*.*?\*\//)
  5.  
  6. # Match single and multi-line comments
  7. Regexp.new(/\/\*.*?\*\//m)

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.