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 » preg_replace
  • 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
  • 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