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
Showing page 2 of 13 (128 total posts)
  • 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
  • PHP HTML table extraction

    I'm writing some data miners that extract data from tables on financial websites, and I've hit a brick wall.  One of the data sets I need to get is a fairly large table, however when i use the following I get nothing back: preg_match_all('|<table.*?>(.*?)(\s*?)</table>|',$page,$matches);  Looking at the ...
    Posted to Construction Advice (Forum) by nouse4anick on May 20, 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
  • Syllables in PHP (English)

    Howdy, I would like to implement a regex of the rules found here for showing a word in its syllables http://www.phonicsontheweb.com/syllables.php  So far, I've got: //lowercases the word, taking out anything other than letters $word = preg_replace('/[^a-z]/is', '', strtolower($word)); //split at: vowels, double ...
    Posted to Construction Advice (Forum) by jordan_6flex on January 26, 2010
  • weird linebreak problem in php preg_replace

    what i'm trying to do is remove all line breaks in and around certain html (or xml if you will) elements (h[0-9], ul, li) from a string the following works fine for removing leading and trailing line breaks, but not the ones inside the element: $text = ...
    Posted to Construction Advice (Forum) by blarg on January 12, 2010
  • regexp to replace the number by the characters

    hi I have a string like this: Code: $ maCahine = (1 and 2 or 3) I have a php regexp: Code:  $ reg = "# (\ () (0,1) \ s * $ number \ s * (and | or | \)) # i to replace the number by string has provided the number preceded by "(" and follow either by AND or OR or "). then I use php preg_replace function to replace. but I ...
    Posted to Construction Advice (Forum) by devMan on December 24, 2009
  • mod_rewrite invents "php"

    Hello,   We tried to figure that out, but we could not find a solution yet. So please give us some kind of advice.   These are the essential lines: RewriteRule ([a-zA-Z0-9]+)/([a-zA-Z0-9]+)\.html$ index.php?tp=$1&up=$2 [L] RewriteRule ([a-zA-Z0-9]+)/$ index.php?tp=$1 [L] RewriteRule ([a-zA-Z0-9]+)$ index.php?tp=$1 [L] ...
    Posted to Construction Advice (Forum) by Realspace on October 29, 2009
  • REG_BADRPT when i'm trying to test a regex with ereg (POSIX)

    Hello everyone, I'm pretty new to regexes and I've got a small problem. I have the following regex: (?<=lblVacant">(ab )?)([\d,.\/]+)(?=(<\/span>|\s\-)) which should match ose1_DetailEstateData1_lblVacant">06.08.2009 - 30.10.2009</span></td> ailEstateData1_lblVacant">10.08.2009 - ...
    Posted to Construction Advice (Forum) by Olty on August 6, 2009
  • find if either stringa or stringb do not exist in a string

    I am working on making a bbcode system with php using preg_replace(), and I am making it so that other tags will not work inside of a code block. This is the code I am currently using, it almost works: /(?!\[code\])(.*)(\[b\])(.+)(\[\/b\])(.*)(?<!\[\/code\])/Usi  what I want it to do is if [*code] and [*/code] are around the text inside, ...
    Posted to Construction Advice (Forum) by sarathi on July 31, 2009
  • PHP regex

    I need help with a regular expression in PHP, I have made a small forum, and I am adding features, up until now whenever someone types a url "http://..........." I use a regex to make a link, but now I have new features, one of them is adding youtube videos, to do this I ask my members to simply type youtube(youtube_url) the problem is ...
    Posted to Construction Advice (Forum) by djp1@ymail.com on July 25, 2009