conversion problem

Posted by Saravanan05 under ASP.NET on 11/17/2009 | Views : 831 | Status : [Member] | Replies : 1
hi friends

asp

objRegExp = New RegExp
objRegExp.Global = True
objRegExp.IgnoreCase = True
objRegExp.Pattern = "<[^>]*>"
strFileContents = objRegExp.Replace(strFileContents, "")
strFileContents1 = objRegExp.Replace(strFileContents1, ""

above code is asp..i need to conver asp.net(vb script)

i converted like this

objRegExp = New RegularExpressions.Regex

but "Global","IgnoreCase ","Pattern " show error(Global not a memeber of RegularExpressions.Regex
)
objRegExp.Global = True
objRegExp.IgnoreCase = True
objRegExp.IgnoreCase = True
objRegExp.Pattern = "<[^>]*>"
strFileContents = objRegExp.Replace(strFileContents, "")
strFileContents1 = objRegExp.Replace(strFileContents1, ""




Responses

Posted by: Abhi2434 on: 12/3/2009 [Member] [Microsoft_MVP] [MVP] Silver

Up
0
Down
You dont have Global, IgnoreCase or Pattern as properties to Regex class.

Just pass the pattern into its constructor ... I think the pattern that you are using Ignores Case itself, and RegEx works globally.

You use
Dim reg as new Regex("<[^>]", RegexOptions.IgnoreCase)

reg.Replace(strFileContents,"")


I hope this is what you needed.

www.abhisheksur.com

Saravanan05, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response