Peter: Based on your "longer sample," I've written the following *Find:* (?<=class=xl\d{2} style='height:\d{2}\.0pt'>)([^<]+)((<span[^>]+>[^<]+</span >)?</td>\s+<td class=xl\d+>[^<]+(<span[^>]+>[^<]+</span>)?</td>\s+<td class= xl\d+ align=right>)[^<]+(?=</td>) *Replace:* \1\2$<?php displayPrice("\1") ?>
This accounts for everything except the instance that includes this element: <span style='mso-spacerun:yes'> </span> I could update the search pattern to accomodate it, but it would make it even more complicated, and I can't anticipate any other arbitrary garbage Excel decides to insert anyway, so I suggest you run a find/replace to remove them or else figure out why Excel is inserting them. In this case, the "mso-spacerun" element might result from extraneous white-space in your database that you probably don't want there anyway. There are also some problems with your HTML. 1. All attribute values should be enclosed in double-quotes, e.g. <td height="19" class="xl66" style="height:14.0pt"> Apart from not being valid HTML, PHP might have a problem with it too. I don't know much about PHP, but I think it makes a big distiction between double and single quotes. 2. There is no reason (unless you're trying to support prehistoric browsers that can't interpret CSS--good luck with that!) for including height attributes if you also include a style attribute--especially when they contradict each other. In fact, as long as you have a class attribute, you can (and should) apply styles to the elements with a separate style sheet. -- This is the BBEdit Talk public discussion group. If you have a feature request or would like to report a problem, please email "supp...@barebones.com" rather than posting to the group. Follow @bbedit on Twitter: <http://www.twitter.com/bbedit> --- You received this message because you are subscribed to the Google Groups "BBEdit Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to bbedit+unsubscr...@googlegroups.com. To post to this group, send email to bbedit@googlegroups.com. Visit this group at https://groups.google.com/group/bbedit.