Forum OpenACS Q&A: Re: comparing two columns of different tables...

Posted by David Kuczek on
Magic sounds good.... Harry Potter II will be out soon 😉

I thought about some kind of search like the old bboard search. I would copy the result with the highest percentage to table_1. Maybe a combination would be best. Taking out special characters etc and then comparing name_2 with name_1 via search...

The problem in a little more detail:

table_1 is my main table. I will add a new column to table_1 which will hold the valuable information from table_2 (one_valueable_column_2). After I matched the tables I will drop table_2 and have the information from table_2 in the new column of table_1.

By the way... a little bit off topic but I've just had a problem with a regexp:

regexp -nocase {Information</b></td>\s*<td>(.*?)</td>} $html_to_search match information

This regexp doesn't search to then *next* </td>, but to the *last* </td> of the page... How can I regexp to the *next* </td>???

Posted by Jeff Davis on
If you put a ? after \s* it should work right. I don't understand why it matters that \s* be non-greedy here but it does. Maybe someone can actually explain it to me...
% set x { 
<td>Blah blah Blah</td>
<td>more blah</td>
% regexp -nocase {nformation</b></td>\s*<td>(.*?)</td>} $x match foo
% set foo
Blah blah Blah</td>
<td>more blah
% regexp -nocase {nformation</b></td>\s*?<td>(.*?)</td>} $x match foo
% set foo
Blah blah Blah