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

Browse by Tags

All Tags » PHP » 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
  • Changing patterns depending on structure within substring

    Hi regex experts, I’m searching for a regular expression for PHP’s preg_replace() in order to adjust concatenated strings (no multi-line). These strings are fragments in German which form a sentence and therefore need to be (automatically) edited to adhere to grammar conventions. Roughly speaking, the regular expression should ...
    Posted to Construction Advice (Forum) by casualcoder on March 20, 2010
  • Look ahead and Look behind

    I've been trying to match the pattern below for about a week and can't seem to get it right. I need to match a specific string that is not hyper-linked or enclosed in brackets.I'm sure the code below won't match what i need. It's simply to illustrate what i'm aiming to accomplish: [^\{] word here[^\} ]  Any ...
    Posted to Construction Advice (Forum) by emarket78 on March 31, 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