> I'm just smashing all the table tags so that I can keep his content
> and re-style it with CSS once all the tables are gone. How do I select
> all <table>,</table>,<tr>,</tr>,<td> and </td> at once and delete
> them?
Find (</?table|</?tr|</?td|</?tr)[^>]*> and replace with '' might work.
Alex Satrapa | web.mac.com/alexsatrapa | Ph: 0407 705 332
--
You received this message because you are subscribed to the
"BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to bbe...@googlegroups.com
To unsubscribe from this group, send email to
bbedit+un...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/bbedit?hl=en
If you have a feature request or would like to report a problem,
please email "sup...@barebones.com" rather than posting to the group.
There is no need to use a non-greedy quantifier in this particular pattern.
[^>]*> and [^>]*?> are completely equivalent in what they will match.
Either way, you're matching exactly as many non-">" characters as there
are up to the first ">" character.
Ronald
please email "sup...@barebones.com" rather than posting to the group.
Just do a Replace All with the pattern in the Find field and nothing in the
Replace field.
Ronald
>Now I'm stuck with a search window that lists all the tags that were
>found, but I don't know how to delete them all. Intuitively I want to
>select all and delete, but it doesn't seem to work like that. Using
>the find/find all/replace dialog box doesn't seem to be able to do it
>all at once. How do I do this all at once? Thanks everyone. I'll refer
>back to the more detailed GREP responses once I understand GREP a bit
>better.
I assume that you did a find to test the search. All you need to do
to actually delete them is to change your request from a find to a
find/replace and place a space in the replace box. This will remove
the tags and place a space where they were.
>Now I'm stuck with a search window that lists all the tags that were
>found, but I don't know how to delete them all. Intuitively I want to
>select all and delete, but it doesn't seem to work like that. Using
>the find/find all/replace dialog box doesn't seem to be able to do it
>all at once. How do I do this all at once?
You need to study BBEdit more. There (of course) is a Replace
All command.
BUT before you do that...
What people have been suggesting is using the search pattern for
the table element markup and replacing each instance with '' -- nothing.
Before you do that, you might consider replacing table element
markup with some easily identifiable character(s), allowing you
to more easily see where the former table markup was, and also
use additional find/replace steps to begin putting your
non-table markup/css in place.
If I were dismantling tables with this brute force "I have to do
it fast" approach, perhaps not knowing for sure yet exactly how
the contents of the tables will be marked up in the new version,
I would at least throw in some white space. Something like
replacing <table> tags with two blank lines, <tr> tags with one
blank line, and <td> & <th> tags with a newline and a tab
(\r\t). That would at least let me see the what was left in
separate pieces.
You could just as easily replace <table> tags with <div> tags,
<tr> tags with <p>, and <td> & <th> with <span>. Taking this
further, try:
replace <table> tags with <div class="former_table">
replace <tr> tags with <p class="former_row">
replace <th> tages with <span class="former_heading">
replace <td> tags with <span class="former_cell">
You're not stuck forever with those classes named "former..." --
you can always do find/replace on them once the stuff being
marked up is integrated with your new css/markup scheme. In the
meantime, though, you have every piece of the former table's
content marked up with style-able structures.
But this really depends on whether the table's organization of
its contents maps closely to how you want to organize the
content in the new version. It probably won't map well, and
you'll have to do some hand work rearranging the content to work
with css layout. Then I think your job is simpler if you do
something like what I've suggested in above with white space.
HTH
- Bruce
_bruce__van_allen__santa_cruz_ca_
please email "sup...@barebones.com" rather than posting to the group.
You need to study BBEdit more. There (of course) is a Replace All command.
BUT before you do that...
What people have been suggesting is using the search pattern for the table element markup and replacing each instance with '' -- nothing.
Before you do that, you might consider replacing table element markup with some easily identifiable character(s), allowing you to more easily see where the former table markup was, and also use additional find/replace steps to begin putting your non-table markup/css in place.
> I've looked into it a bit more and I've realized that I'm going to
> need to get good at regular expressions to become a half-way decent
> worker; they seem really powerful for automating monotonous tasks and
> working quickly. Thanks for pointing me that way.
I recommend "Mastering Regular Expressions" - http://oreilly.com/catalog/9781565922570
Alex Satrapa | web.mac.com/alexsatrapa | Ph: +61 407 705 332
Actually, you can do that with the Multi-File Search command, in the
Search menu.