Got more questions? Find advice on: ASP | SQL | XML | Windows
in Search
Welcome to RegexAdvice Sign in | Join | Help

Change the case tags to lowercase

Last post 08-27-2008, 12:17 PM by ddrudik. 6 replies.
Sort Posts: Previous Next
  •  08-27-2008, 11:15 AM 45696

    Change the case tags to lowercase

    Hello everyone,

     

    I am trying to convert the tags that are between < > to lower case for example

    <IMG HEIGHT="200" Width="100" />

    in that situation I want to change the case of the tags to lower case like <img height="200" width="100" />

    and all the other tags such as <BR /> to <br /> and so on

     

    Thanks

  •  08-27-2008, 11:31 AM 45697 in reply to 45696

    Re: Change the case tags to lowercase

    include tag values such as name="SOMENAME" to name="somename"?
  •  08-27-2008, 11:31 AM 45698 in reply to 45696

    Re: Change the case tags to lowercase

    AFAIK, there is no regex flavour that does this. You could match everything between the < and > like this:

     <[^>]++>

    and then use the string library/api of the programming language you're using to change to lower case.

  •  08-27-2008, 11:37 AM 45699 in reply to 45697

    Re: Change the case tags to lowercase

    Yes excactly like that, isn't there any way to change the case in regex. I'm not using any programming language, just plain html and I'm doing it from a regex program called TestBed where I can try regexs and see them live
  •  08-27-2008, 11:39 AM 45700 in reply to 45699

    Re: Change the case tags to lowercase

    Do you have the ability to run PHP scripts?
  •  08-27-2008, 11:39 AM 45701 in reply to 45697

    Re: Change the case tags to lowercase

    ddrudik:
    include tag values such as name="SOMENAME" to name="somename"?

    Sorry not those values, just the tags such as Name and img and A stuff like that

  •  08-27-2008, 12:17 PM 45709 in reply to 45701

    Re: Change the case tags to lowercase

    Not a problem.  Do you have the ability to run PHP scripts and (a web server with PHP installed)?  If so, I can provide a script that will process text files to make this replacement for you.
View as RSS news feed in XML