I currently have the following code in VB .Net:
Dim matchcollection As System.Text.RegularExpressions.MatchCollection Dim currentmatch As System.Text.RegularExpressions.Match Dim lowercasetag As String matchcollection = Regex.Matches(lines, "\[(?i)(.+?)\]") For Each currentmatch In matchcollection lowercasetag = currentmatch.ToString.ToLower lines = Regex.Replace(lines, "\[(?i)(.+?)\]", "[" & lowercasetag & "]") Next
The variable lines comes in as a string. The Regex is supposed to detect BBCode tags regardless of case (which is does perfectly) and then drop the case down to lower case.
However, it seems that the lowercasetag variable cannot be understood by regex. I was wondering whether I was doing something wrong, or if there were an alternative way of doing this.
Edited by aommaster, 24 June 2009 - 08:10 AM.