Title |
Test
Find
Pattern Title
|
Expression |
(?<commentblock>((?m:^[\t ]*\/{2}[^\n\r\v\f]+[\n\r\v\f]*){2,})|(\/\*[\w\W]*?\*\/)) |
Description |
This expression will match comment blocks in javascript, c, c++, etc
I wrote this as a named group called "commentblock", as I like to use it with other expressions.
It avoids single line comments or inline commented code (which are not considered comment "blocks") unless the comments are in a /* text */ comment style
could not create a multiline example in the matching examples, here is what I tried to enter
// Some text
//(must be two or more lines long and each line may only be preceded by whitespace)
|
Matches |
/* Some text (may be any number of lines) */ |
Non-Matches |
// Some text (only a single line) | Some code // comment here (even if next line has comment) | /* S |
Author |
Rating:
Not yet rated.
Chris Strolia-Davis
|
Source |
|
Your Rating |
|
Title: great
Name: Cawabunga
Date: 4/30/2009 3:45:40 AM
Comment:
i just need it for my java project, thanks