Title |
Test
Find
C++ Comments
|
Expression |
//.*|/\*[\s\S]*?\*/ |
Description |
Matches single line or multi-line comments. |
Matches |
// Comment here | /// Comment here | /* Cmment Here */ | /**** Comment Here ****/ |
Non-Matches |
/ * Comment Here */ | /* Comment here * / |
Author |
Rating:
Bill Krahmer
|
Source |
Bill Krahmer |
Your Rating |
|
Title: Test in Javascritp
Name: PacoDw
Date: 4/15/2018 4:46:23 PM
Comment:
It's the best, I had to change it a bit to use in javascript but it is the same. Here is the change:
const regex = new RegExp("//.*|/\\*[\\s\\S]*?\\*/","g");
Title: test
Name: foooo
Date: 10/25/2012 12:08:04 AM
Comment:
//
//fffdasf
//
Title: test
Name: foooo
Date: 10/25/2012 12:07:48 AM
Comment:
//
//fffdasf
//
Title: fast and furious regex dude!
Name: sombriks
Date: 9/27/2011 8:48:15 AM
Comment:
the best part is the performance with java String.matches for the cases when the expression must return false. Other versions always threw me in some kind of endless loop, but not this one, it's like a thunderbolt!