Title |
Test
Find
Pattern Title
|
Expression |
(\/\*(\s*|.*?)*\*\/)|(--.*) |
Description |
This pattern will match any multi-line or single line comments in TSQL (Stored Procedures or SPROC's) in MS SQL Server. |
Matches |
/* My Comment */ | -- A single line comment |
Non-Matches |
*/ Won't work /* | // Not likely | - uh uh |
Author |
Rating:
Todd Davis
|
Source |
|
Your Rating |
|
Title: Comment comment
Name: Eton
Date: 11/6/2006 11:56:18 AM
Comment:
Pretty good but I'm lookingfor one that won't return a false positive when searching javascript source on a statement such as this:
if(!str.match(/^\[tr\]/i)){str=str.replace(/\[\/*?tr\]/g,"\u00AE");}
My own construct /(?!\\)(\/\*(?:\w|\W)*?\*\/)/gim for some reason won't work. The lookahead apparently needs a character in front of it in order to work (although .net is perfectly happy to return results in RETester). I need to find another way to ignore escaped comment delimiters without including it in the match.