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 » php
  • 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 matches in HTML

    I'm trying to find words in HTML that are between tags using PHP (v5.2.6) preg_replace. The following rules apply to the matches full word match only (can also be matched when adjacent to non-word characters such as commas, parenthesis, periods, question marks, exclamation marks, percentage, dollar signs) e.g. "test" would ...
    Posted to Construction Advice (Forum) by mrboskits on July 16, 2009
  • [PHP] Regex to paste templates

    Hello RegexAdvice users. I am at this time trying to update my template system, and i have desidet to use regex insted of ALOT of explodes :D I this i will start out with showing you what my templates look like. code:<html> <head> <title>Some test</title> </head> <body>    <php:if ...
    Posted to Construction Advice (Forum) by doomstone on November 6, 2008
  • 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 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
  • preg_replace outside xhtml tags

    I'm trying to replace all occurences of a word outside xhtml tags in in xhtml source code using preg_replace() in PHP. For example I don't want to accidently replace the <body> tag when trying to replace all all occurences of 'body' with 'torso' in the xhtml code. I've been trying ...
    Posted to Construction Advice (Forum) by mikkelwe on December 22, 2006