RegExLib.com - The first Regular Expression Library on the Web!

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Pattern Title
Expression
/\*((?!\*/)[\d\D\s])*\*/
Description
Matches /* style comments */. Matches whitespace (so can detect tabs, etc.) Problems with nested comments.
Matches
/* CSS comments */ | /* multi-line SQL/CSS/Etc comments */
Non-Matches
<!-- doesn't match --> | -- won't match and //won't match
Author Rating: Not yet rated. Mike Campbell
Source
Your Rating
Bad Good

Enter New Comment

Title

Name

Comment

Spammers suck - we apologize. Please enter the text shown below to enable your comment (not case sensitive - try as many times as you need to if the first ones are too hard):

Existing User Comments

Title: test
Name: test
Date: 6/5/2007 9:36:04 AM
Comment:
linda john zoie


Title: Excellent, Thanks!
Name: Michael K. Campbell
Date: 6/21/2005 11:41:29 AM
Comment:
Excellent. Yeah, guess I should have looked at that a little more. \s\S was, of course, all it needed. (Now I just need to worry about the look-aheads so that nesting works correctly... )


Title: the [\d\D\s] is unnecessarily complicated
Name: Randal L. Schwartz
Date: 6/21/2005 7:22:08 AM
Comment:
A simple [\s\S] would have done.


Copyright © 2001-2024, RegexAdvice.com | ASP.NET Tutorials