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

Browse by Tags

All Tags » preg_replace
  • How to replace multiple matched patterns with multiple patterns?

    Hi,  Let me explain the scenerio: I have the input text "Mr. XYZ is a very nice person and have a very good taste of humor" I want to write one replace string and once pattern string such that I can do the following things: er -> gh av -> th these are two papperts that I can match with the pattern string ...
    Posted to Construction Advice (Forum) by princeoo7 on November 10, 2008
  • regular expression to replace the given instance of word in a text

    Hi, Anybody knows how to replace the second or third instance of word in a text using regular expression in php (preg_replace()) For example, I have an article about car and let's say the word car occurs 10 times. Now I want to replace the 3rd and 7th instance of car with some other word. How can I do this with php regular ...
    Posted to Discussion (Forum) by namus25 on November 5, 2008
  • preg_replace

    Hi,, Any body please help me on this preg_replace.. My need is to add one extra space to in front of the characters except some limited character. For any tag which has the form "<XXXXX> OR</XXXXX> should be added one extra space like " <XXXXX> OR </XXXXX>" except "<span> OR ...
    Posted to Construction Advice (Forum) by rajeevattingal on October 27, 2008
  • BBCode conversion

    Hi, I asking for help in my PHP code optimization. I try to rewrite my old/slow BBCode conversion function to use regex. The allowed BBCodes are [ b]text[ /b] [ i]text[ /i] [ url]domain.com[ /url] or [ url]domain.com|domainname[ /url] [ img]filename.ext[ /img] or [ img]filename.ext|description[ /img] It is possible to construct ...
    Posted to Construction Advice (Forum) by pandor on August 23, 2008
  • comma separated numeric values

    Hi,  In PHP I'm trying to filter the string looking for: [options=1,6,22,103] and then to extract numeric values into the array. As I just started my fun with regular expressions, the only way I can do it is like: preg_match('\/[options=(.*?)\]/', $content, $matches); But that will return numbers separated with commas, which ...
    Posted to Construction Advice (Forum) by Akashic on July 18, 2008
  • Find a Word outside of Tags

    Hello see this text:foo bar <b> foo bar</b>  foo bar <b> foo bar</b>  foo bari need a expression, which finds all the foo expect the <b>-included like here underlined: foo bar <b> foo bar</b> foo bar <b> foo bar</b>  foo barThere can be many <b>-Tags. They are correct ...
    Posted to Construction Advice (Forum) by alois on March 3, 2008
  • Needed: Regular Expression to escape single and double quotes

    Hello! I am using PHP and preg_replace.  I have output from an XSL transformation that I would like to insert into a mysql database.  I would like to construct a regular expression that escapes single and double quotes.  My data set looks like this: <escape>Welcome to Barbara's ...
    Posted to Construction Advice (Forum) by pimpkracker69 on January 29, 2008