mattcampbell
30th June 2007, 11:58 AM
I have a probelm with pattern matching.
I get the following debug:
Debug: [2007/06/30 19:42:21] Failed Test
Debug: [2007/06/30 19:42:21] Pattern: /\<table width\="100%" border\="0" align\="center" cellpadding\="3"cellspacing\="0"\>\<tr valign\="top" class\="contentr"\>\<td width\="24%"\>\<strong\>Field 1\<\/strong\>\<\/td\>\<td width\="32%"\>\<strong\>Field 2\<\/strong\>\<\/td\>\<td width\="24%"\>\<strong\>Field 3\<\/strong\>\<\/td\>\<td width\="20%"\>\<strong\>Field 4\<\/strong\>\<\/td\>\<\/tr\>/i
Debug: [2007/06/30 19:42:21] Content: '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><!-- #BeginTemplate "/Templates/pari...'
Debug: [2007/06/30 19:42:21] ---------------------
Debug: [2007/06/30 19:42:21] Rollback execution of section: Tests
The pattern is:
<Pattern>
RegExp <table width="100%" border="0" align="center" cellpadding="3"\
cellspacing="0">\
<tr valign="top" class="contentr">\
<td width="24%">Field 1</td>\
<td width="32%">Field 2</td>\
<td width="24%">Field 3</td>\
<td width="20%">Field 4</td>\
</tr>
</Pattern>
<Section While>
Name Parish
<Pattern>
RegExp <tr valign="top">\
<td class="content">{$field1} ({$link})</td>\
<td class="content">{$field2}</td>\
<td class="content">{$field3}</td>\
<td class="content">{$field4}</td></tr>
</Pattern>
The HTML code is:
<table width="100%" border="0" align="center" cellpadding="3" cellspacing="0">
<tr valign="top" class="contentr">
<td width="24%">Field 1</td>
<td width="32%">Field 2</td>
<td width="24%">Field 3</td>
<td width="20%">Field 4</td>
</tr>
<tr valign="top">
<td class="content">Content 1 (itemdetail.asp?item_id=329)</td>
<td class="content">Content 2</td>
<td class="content">Content 3</td>
<td class="content">Content 4</td>
</tr>
It seems the pattern is adding / and \ to the pattern and therefore not finding a match. But I'm not sure.
Appreciate any help
I get the following debug:
Debug: [2007/06/30 19:42:21] Failed Test
Debug: [2007/06/30 19:42:21] Pattern: /\<table width\="100%" border\="0" align\="center" cellpadding\="3"cellspacing\="0"\>\<tr valign\="top" class\="contentr"\>\<td width\="24%"\>\<strong\>Field 1\<\/strong\>\<\/td\>\<td width\="32%"\>\<strong\>Field 2\<\/strong\>\<\/td\>\<td width\="24%"\>\<strong\>Field 3\<\/strong\>\<\/td\>\<td width\="20%"\>\<strong\>Field 4\<\/strong\>\<\/td\>\<\/tr\>/i
Debug: [2007/06/30 19:42:21] Content: '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><!-- #BeginTemplate "/Templates/pari...'
Debug: [2007/06/30 19:42:21] ---------------------
Debug: [2007/06/30 19:42:21] Rollback execution of section: Tests
The pattern is:
<Pattern>
RegExp <table width="100%" border="0" align="center" cellpadding="3"\
cellspacing="0">\
<tr valign="top" class="contentr">\
<td width="24%">Field 1</td>\
<td width="32%">Field 2</td>\
<td width="24%">Field 3</td>\
<td width="20%">Field 4</td>\
</tr>
</Pattern>
<Section While>
Name Parish
<Pattern>
RegExp <tr valign="top">\
<td class="content">{$field1} ({$link})</td>\
<td class="content">{$field2}</td>\
<td class="content">{$field3}</td>\
<td class="content">{$field4}</td></tr>
</Pattern>
The HTML code is:
<table width="100%" border="0" align="center" cellpadding="3" cellspacing="0">
<tr valign="top" class="contentr">
<td width="24%">Field 1</td>
<td width="32%">Field 2</td>
<td width="24%">Field 3</td>
<td width="20%">Field 4</td>
</tr>
<tr valign="top">
<td class="content">Content 1 (itemdetail.asp?item_id=329)</td>
<td class="content">Content 2</td>
<td class="content">Content 3</td>
<td class="content">Content 4</td>
</tr>
It seems the pattern is adding / and \ to the pattern and therefore not finding a match. But I'm not sure.
Appreciate any help