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

Browse by Tags

All Tags » html » find replace
  • converting self-closing xhtml tags to html

    I have a CMS which is written to output xhtml.  I am trying to write a php script that will convert the system - completely and permanently - to output html instead.  The sticking point is creating a regex to find self-closing xhtml tags (e.g., <img /> ) and convert them to non-self-closing html tags (e.g., <img>).  I am ...
    Posted to Construction Advice (Forum) by traq on August 17, 2010
  • Replace bgcolor attributes with a style in any html tag

    Hi guys,   Sure this is probobly simple but my head just can't get around this issues... I'm trying to parse the HTML to start replacing/removing problem tags to meet W3C AA compliance and various other requirements. The first one i'm working on is removing the 'bgcolor' attribute of any table/tr/td tag. But using the ...
    Posted to Construction Advice (Forum) by PommyTom on July 4, 2007
  • RegEx Help - Replacing hrefs

    OK. Stick with me here. It is going to take me a few to explain this. I am writing a small application in VB.NET. The ultimate task is to make a web browser, within a web browser. Basically, You open IE, FireFox, Safari, or whatever browser you like and go to the web application I am building. At the top of the web page, I have a tool bar, ...
    Posted to Construction Advice (Forum) by TampaWebDevelopment on June 27, 2007
  • CSS Matching

    I am working in Coldfusion trying to match CSS items that are NOT listed. For instance, I have this code to match:    <div style='color:#444444;float:none;'>Test Text</div>   I have the code matched down to:    color:#444444;float:none;   My regular expression to match CSS items ...
    Posted to Construction Advice (Forum) by jimbo2150 on April 16, 2007
  • Re: Detect content of tags

    Give this a shot. (<[^>]*>)[^<>/]*(padding)[^<>/]*(</[^>]*>) Same trick as before the middle group is what you want to replace each time. First and Third groups are the html tags around content. Any word you want to find can be put into that middle ...
    Posted to Construction Advice (Forum) by Brendan on March 6, 2007
  • Re: regex to replace &quot; with " inside html tags only (using php) or the other way round

    Thanks again Sergei. I found the solution, your regex was perfect, it's just a PHP oddity. This page on php.net: http://www.php.net/manual/en/function.preg-replace.php describes pre_replace and c_stewart0a at yahoo dot com had the solution which is: "you will want to quote your searching expression with /" This did the job. So ...
    Posted to Construction Advice (Forum) by neilcraig on January 29, 2007
  • regex to replace &quot; with " inside html tags only (using php) or the other way round

    Hi everyone I'm very new to regular expressions and currently trying to write a regex to replace all instances of the string &quot; with " inside html tags. An example string which i am testing with is: "miaow" said the cat <a href="http://www.something.com" title="hello">this is "not" ...
    Posted to Construction Advice (Forum) by neilcraig on January 29, 2007
  • converting paths from relative to absolute

    I'm trying to convert all relative paths within a html page into absolute paths.  I've searched quite a bit and not found anything that does exactly what I'm trying to do. I'm using .Net to do the replacement.  Here is the pattern I have so ...
    Posted to Construction Advice (Forum) by evance on October 31, 2006
  • preg_split HTML specific HTML tags?

    Hi, I'm working in PHP4, and want to use preg_split() to make a string like:   <span> On October 17th 2006 at 10:40 am 1710 User 1 wrote:</b> AIRPORT TERMINAL 1</span> <span> On October 17th 2006 at 11:00 am Res Test 1 wrote:</b> This booking has been accepted. </span> <span> On ...
    Posted to Construction Advice (Forum) by d57rich on October 31, 2006
  • Tough (X)HTML problem

    I am writing a web-based rich-text editor (such as the one which you use to write the posts on this forum) in ASP.Net (VB.Net). The problem is: Mozilla and IE format the HTML in different ways, and I need a common code, as people using different browsers must be able to edit the same text. The problem is specifically with bold, italic and ...
    Posted to Construction Advice (Forum) by todbr on September 9, 2006