Regular Expressions 101

Community Patterns

T-SQL find comments in script

1

Regular Expression
.NET 7.0 (C#)

@"
(?<comment>/\*.*?\*/|\-\-.*?$)
"
gmis

Description

Finds the comments in a t-sql (tsql) script

Submitted by Paw Jershauge - a month ago