Posted By

mikegreen on 07/05/08


Tagged

regex css javascript ruby


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

vali29
Tyster


Match CSS and JS Comments


 / Published in: Regular Expression
 

Matches CSS-style comments spanning one or multiple lines

  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
Posted By: IdaWallace on November 23, 2018

Thank you so much for providing here coding for Match CSS and JS comments spanning one or multiple lines. Very helpful coding for also IT learners.

Ida, Marketing assignment writer - http://www.assignmenthelpfolks.com/marketing/, also assist IT students at Assignment Help Folks in Australia.

You need to login to post a comment.