Table of Contents - Regular Expression

Steve Sweales
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 14, 2013

I need to be able to supress certain headings within my table of contents on a Confluence page.

The headings I need to surpress are:

- Page Views
- Recently Updated
- Release Items (xx issues)

The xx within brackets will be different depending on what comes back from a JIRA feed.

I have absolutely no idea about regular expressions. Is it possible to write a regular expression to surpress these headings?

If so, would anybody be kind enough to help me out? :-)

3 answers

1 accepted

5 votes
Answer accepted
Steve Sweales
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 16, 2013

It's ok, figured it out myself ...

Views|Recently Updated|Release Items.*|

Pauline Monroy March 12, 2020

I used this to exclude a heading "Table of contents" itself :D 

Pauline Monroy March 15, 2020

Ok, I've hit a snag here. 

I wanted to remove the headings Document details and Table of contents when using the TOC macro. 

I used this regex: Document details|Table of contents.*| in the exclude headings section.

It renders the correct result I need in the macro's preview. (Refer SS 1)

TOC issue.png

But upon publishing the page, TOC is empty. 

I tested the macro again without the Regex, it works fine, included it shows me the headings I wanted to exclude.

What could be the issue here?

2 votes
Pauline Monroy March 15, 2020

Try (Table of Contents|Views|Recently Updated|Release Items).

 

I used (Table of Contents| Document details) and it worked.

Toc Fixed.png

0 votes
m
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 15, 2013

Hi Steve,

Can you tell us which version of Confluence are you running?

Also, if you can attach a screen capture of your page. The reason I ask is that release items don't normally display on each page...so to see a screen capture would clarify.

Mary

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events