A
alexvorn2
This is the code for finding a text that is between "<" and ">":
Dim fileContents As String =
My.Computer.FileSystem.ReadAllText("c:/test.txt")
Dim RegularExpression As New
System.Text.RegularExpressions.Regex("<((.|\n)*?)>")
Dim returnValue As String =
RegularExpression.Replace(fileContents, "<>").Trim
My.Computer.FileSystem.WriteAllText("c:/test.txt",
returnValue, False)
How to get the "regularexpression" length and if it's less 10
characters to replace it?
Example if:
<123456789> to replace with <>
<1234567890123> to do nothing
<12345> to replace with <>
<123546789123456789> do nothing
Thanks!
Dim fileContents As String =
My.Computer.FileSystem.ReadAllText("c:/test.txt")
Dim RegularExpression As New
System.Text.RegularExpressions.Regex("<((.|\n)*?)>")
Dim returnValue As String =
RegularExpression.Replace(fileContents, "<>").Trim
My.Computer.FileSystem.WriteAllText("c:/test.txt",
returnValue, False)
How to get the "regularexpression" length and if it's less 10
characters to replace it?
Example if:
<123456789> to replace with <>
<1234567890123> to do nothing
<12345> to replace with <>
<123546789123456789> do nothing
Thanks!