Couldn't agree more with you!GeertDD wrote:...
One more argument to go for the strpos() check instead of trying to make the regex do all the work. ...
Am I doing something wrong?
Moderator: General Moderators
- prometheuzz
- Forum Regular
- Posts: 779
- Joined: Fri Apr 04, 2008 5:51 am
Re: Am I doing something wrong?
Re: Am I doing something wrong?
Thanks a lot guys 
I have solved the problem, and more importantly, I have learned many *good* things!!
I have solved the problem, and more importantly, I have learned many *good* things!!
GeertDD wrote: Yeah, you are probably right. One more argument to go for the strpos() check instead of trying to make the regex do all the work. Why? Because you don't know for sure which part comes first within the query string: task or itemid? The regex would have to check both possibilities. Let me just quickly try to cook something up (not tested), just as an example of how ugly it gets.
Code: Select all
$regex = '/<a\s++href="([^"]*\b(?:task=view\b[^"]+\bitemid=123|itemid=123\b[^"]+\btask=view)\b[^"]*+)"[^>]*+>([^<]++)/i';