I am building a table of contents using AuthorTools. I used it to create cell tags so the TOC can make hyperlinks, but then I decided I wanted to change them. But I am having trouble removing the old tags.
Here's what I did, after first making a few sample Section and Subsection cells:
<< AuthorTools`
nb = Notebooks[][[1]]
Paginate[nb]
MakeContents[nb, "Book", CellTagPrefix -> "c:"]
That worked as desired (and it made tag names like "c:1", "c:2"), but then I decided I wanted to change the prefix to "toc:". To remove the old tags, I tried:
RemoveCellTags[nb, StringExpression["c:", __]]
but it didn't change any cell's tags. The following did work, however, to remove just one tag:
RemoveCellTags[nb, "c:1"]
So I think I am using StringExpression
wrong. And yet, this works fine:
StringCases[{"c:3", "c:4"}, StringExpression["c:", __] ]
(* OUTPUT: {{"c:3"}, {"c:4"}} *)
So, what should the input be to RemoveCellTags
to get rid of all tags that start with "c:"?