[thelist] Regex and converting HTML tags to lower case

Burhan Khalid thelist at meidomus.com
Sat Nov 8 06:52:56 CST 2003


Bruce MacKay wrote:

> Hi folks,
> 
> New to regex and predictably I am encountering a problem.  I want to 
> convert all HTML tags to lower case.
> 
> I can identify the tags in regex, but I cannot find any online examples 
> of using that info to convert the tags to lower case.
> 
> 
> function fnLowerCaseHTML(strHTML)
>   Dim objRegExp, strOutput
>   Set objRegExp = New Regexp
>   objRegExp.IgnoreCase = True
>   objRegExp.Global = True
>   objRegExp.Pattern = "<(.|\n)+?>"
>   strOutput = ?????
>   fnLowerCaseHTML = strOutput
>   Set objRegExp = Nothing
> End Function
> 
> Can anyone help me?  Is it possible to do what I'm trying to accomplish 
> with regex?

It is, but I don't know how to go about it in ASP (which is what you are 
using). In PHP, there is a preg_replace which does what you want. Maybe 
you can find a (or someone can suggest a) ASP equivalent.

Although I'm not a ASP guru, but this link (wrap warning) should help 
you out :

<http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/vsobjregexp.asp>

<tip author="Burhan Khalid" type="MSDN Searching">

   Trying to search msdn.microsoft.com for something?
   add site:msdn.microsoft.com to your google query
   and use google to search msdn.microsoft.com

</tip>

Sorry couldn't be of more help :(

-- 
Burhan Khalid
thelist[at]meidomus[dot]com
http://www.meidomus.com
-----------------------
"Documentation is like sex: when it is good,
  it is very, very good; and when it is bad,
  it is better than nothing."



More information about the thelist mailing list