Hi, How would you negate a string in preg_match Say I want it to find everything in a string EXCEPT that containing "</" in it. I tried /([^(<\/)]*/ and /([^<\/]*/ but its not working. I understand [^<]* would parse anything not including "<" , but how can I do the same thing for 2 characters, being "</" in my case? Thanks in advance, Armin
Thanks for your answer but this is not what I want. This will match ignore things that have a "<" OR "/" in the string, but I ONLY want it to ignore strings with "</" in them. So the sequence "</" CANNOT appear, but < and / individually can. Any clues?
querying all links from a certain domain: say the domain is "domain.com" and there is a link like <a href="http://www.domain.com" target="_blank" title=""><img src="http://www.domain.com/images/domaiimage.jpg" alt="" /></a> on the page.. I want all anchors returns including that domain.com in the href. All links basically with "domain.com" in the href.
What exactly does the "?" do here? I understand .* means anything but carriage return, but whats the ? for? Armin
This would be more precise, in whats the OP is looking for: http://www.regular-expressions.info/reference.html
Figured it out. Now .. to the next problem I now need to do the opposite. I need to grab urls that are NOT of a certain domain... how can I negate a sequence of characters if I did something like [^domain.com] , it wouldnt work since it negates each character individually no?