Quick Nav:  Online Store   |   Login | Register

Debugging --- Yuk

Rate this topic:

Please Register to post a reply. Another benefit of registration is the ability to subscribe to and recieve notifications of new posts.
AuthorMessages
DavidWSnow
<250Posts
Posts:192


05/17/2008 12:33 PM  

I have been working again at using PageBlaster replacement rules along with data pulled out of my database via listX to make the dynamic data from www.AgingSafely.com's database change dynamicly on each of the sites we host's wet portals.

I am testing / debugging this on our sample web site Basic.AgingSafely.com   The Contact Information block is a ListX module who's Query contains the index for the data record. Hidden in the text between < noscript >< /noscript > tags a the pieces of data that I want to move elsewhere on the page. I have rules that I have used for 9 months now that move titles and descriptions to the correct spots.

Note: Extra spaces around < and > are to keep Active Forumn happy

Today's effort was to replace WebSiteVacancyToken  with text inside   < span id="WebSiteVacancy" >< /span >

The actual text will come from the ListX {IIF,"'[Vac]'='0'","", "< h3 class='vacancy' >Currently Has Vacancy< /h3 >"}  and should either be empty or a H3 statting that the home has a vacancy.  The ListX part works ok.

I though this would be really easy because I was replaceing text and not meta-tags. The rule looks like:

Replace:

(.*?)WebSiteVacancyToken(.*?)< span id="WebSiteVacancy" >(.*?)< /span >(.*)

With:

$1 $3 $2 $4

 

The result is that just this portal hangs "loading" forever. I have to edit web.config to disable PB via FTP and then tweak the rule.  This process is repeated until the brain is fried.  I should not have done this on my production server, but that is life.

 

John I would suggest that there be an easier way to disable PB and editing web.config.  Maybe in the global control panel.   Any suggestions on degugging this, or on fixing the rule?

 

/DaveS

 

 

 

John Mitchell
Posts:3276


05/17/2008 2:39 PM  

I think it is probably that last capture group #4.  I'm not sure why you would want to capture it and put it back in the same place.  You should be able to just remove that part and leave that group out of the replacement.

For debugging RegEx, I highly recommend RegEx Buddy

It can really save you a lot of time, and it has a debugging feature that tells you exactly how good your Regex pattern is plus it will timeout and let you know when you have catastrophic backtracking.

You can disable PB without changing the web.config completely by putting an excludeFrom="All" pattern in your global config, but that won't help with the problem you are currently having because what you have done is basically put the worker process in a never ending loop.  The only way to stop that is by restarting the application (or waiting for it to restart itself after detecting deadlock) which is what happens when you change the web.config.

DavidWSnow
<250Posts
Posts:192


05/17/2008 5:19 PM  

Got it.

Replace: Extra spaces around < and > to keep Active Forum happy

WebSiteVacancyToken(.*?) < span id="WebSiteVacancy" > (.*?) < /span >

With: $2$1

Thanks,

DaveS

Please Register to post a reply. Another benefit of registration is the ability to subscribe to and recieve notifications of new posts.



ActiveForums 3.7
Powered by: Snapsis Software