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 regex
  • 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
  • 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
  • replace a word that is not inside a tag

    Hi, I'm using PHP preg_replace function. I need to replace a word inside a text string, that DO NOT match these patterns : <.*".* word.*".*> <h[1-6].*>.*word.*</h[1-6].*> The goal is to replace all occurences of a word inside the html code, on the condition that it's not part of a title ...
    Posted to Construction Advice (Forum) by alex007 on February 11, 2009
  • Extracting some text from a cPanel page

    Hi there, I have a string which is the file_get_contents of a cpanel database creation, user creation etc and I want to strip the extra junk off and just have the relevant data.  Using PHP 5.0.5 on Linux I have tried numerous things but I can't figure it out.  I am not very good with regex yet.  I don't even really know ...
    Posted to Construction Advice (Forum) by rrhode on February 6, 2009
  • preg_match, to match URL in email.

    Hi,  I'm using PHP to parse an incoming email. I wish to be able to match then store URL's contained in the email message. I just need to figure out the RegEx to match URL's.  I've been currently building and testing ...
    Posted to Construction Advice (Forum) by pdxbenjamin on January 24, 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
  • 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
  • Uncommon URL pattern retrieval

    Hi, Anybody out there, I'd be immensly greatful if you helped me fix one regular expressions of mine. Basically I've written a regular expression in PHP identifying a pattern of a certain type of URL REGEX: /(http\:\/\/dx\.doi\.org\/.*?)(\s|$|;|>)/ it will catch strings of URLs from the 'http://dx.doi.org/' domain, looking ...
    Posted to Construction Advice (Forum) by ksyandagger on August 19, 2008
  • php: keep only url from <a href>

    Hi there, I tried finding the information first on regexlib.com but didn't find my exact answer. In php I'm trying to make the http:// part of links visible in a html document, and I got something that works *almost* every time, but sometimes it gives bad results. I was wondering if someone here could help me out? Thanks in ...
    Posted to Construction Advice (Forum) by frank peeters on August 7, 2008