Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Confluence TOC Regex for "last character in the line"?

Kate Secor February 3, 2024

I have a page where I want a table of contents at the top of the page for something that's going on down at the bottom of the page. (They're too far separated to use TOC Zone.)

My workaround was this:

  • Add an "O" to the end of each header I don't want to include and change the font color to white to make it invisible
  • Go into the TOC macro and tell it to exclude any heading that has an O at the end of it

However... my regex in the "Exclude Headings" box isn't doing what I expect it to do, even though the Regex101 validator says it's correct.

I have this:

Screenshot 2024-02-03 155411.png

It's not working -- all of those headers are still showing up in my macro preview and on the page when I save it. What am I missing? 

1 answer

1 accepted

1 vote
Answer accepted
Kate Secor February 3, 2024

Actually, it turns out that it *does* work, and the problem is actually that the preview in the macro window doesn't show the right thing and I had to save all the way out (not go to "Preview", actually save) to see it.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events