Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Regex problem

Status
Not open for further replies.

2ni

Programmer
Mar 21, 2002
36
FR
i want to replace some text using regular expression but it doesn't work :

here is my text (some TSQL)
CREATE PROCEDURE [dbo].[DELETE_FILE]
(@FILE varchar(255))
AS

--Comment

exec master..xp_deletefile @FILE


/*
maxi comment
*/
GO

I want to delete blank lines and comments

Dim re As Regex

InputCode = re.Replace(InputCode, "^\s*\-{2,}.*$", String.Empty, RegexOptions.Multiline)

InputCode = re.Replace(InputCode, "^\s*\-{2,}.*$", String.Empty, RegexOptions.Multiline)

InputCode = re.Replace(InputCode, "/\*[.\n]*\*/", String.Empty, RegexOptions.Singleline)

the second replacement works but the other not. I tried my expression in a regex tester and they matches ! Someone can help me ??

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top