VERY STRANGE! what is this regex problem? [modified]
-
(@import\s|\S+-image:|background:)\s*?(url)*['"(]{1,2}(?!http)\s*/([^"')]+)['")]{1,2} it is working in these link's sources: http://www.hurriyetoto.com/oto/index.php[^ http://eniyion.hurriyet.com.tr/?sz=64757[^ but here it is not responding: http://www.sendeyolla.com/anasayfa.aspx?sz=64757[^ I tried with The Regex Coach, the result is same any ideas???
I want to fly but I don't have wings
modified on Wednesday, August 6, 2008 10:31 AM
-
(@import\s|\S+-image:|background:)\s*?(url)*['"(]{1,2}(?!http)\s*/([^"')]+)['")]{1,2} it is working in these link's sources: http://www.hurriyetoto.com/oto/index.php[^ http://eniyion.hurriyet.com.tr/?sz=64757[^ but here it is not responding: http://www.sendeyolla.com/anasayfa.aspx?sz=64757[^ I tried with The Regex Coach, the result is same any ideas???
I want to fly but I don't have wings
modified on Wednesday, August 6, 2008 10:31 AM
:wtf: ahaa, I found the problem. If the html source has a big VIEWSTATE, it doesn't respond. when I put spaces somewhere in the big viewstate regex was responded. Now I'm removing all viewstates's values :) It's working perfect :)
I want to fly but I don't have wings
modified on Wednesday, August 6, 2008 12:55 PM
-
:wtf: ahaa, I found the problem. If the html source has a big VIEWSTATE, it doesn't respond. when I put spaces somewhere in the big viewstate regex was responded. Now I'm removing all viewstates's values :) It's working perfect :)
I want to fly but I don't have wings
modified on Wednesday, August 6, 2008 12:55 PM
I see. I believe that it's the "\S+-image" part that is making it slow. The \S+ will match the entire viewstate value, but then it will not find "-image" at the end of it, so it will start going back through the viewstate character by character looking for "-image". Use som reasonable limit like \S{1,20} and it should be much faster.
Despite everything, the person most likely to be fooling you next is yourself.