Our new Appfire Documentation Space is now live!

Take a look here! If you have any questions please email support@appfire.com

How to use regex expressions to select attachments - Cloud

Overview

This page demonstrates how to use the Attachment Table macro, which is part of the Advanced Tables for Confluence app, to select attachments based on the space or attachment name using a regex expression.

  • Use the special @self value for the Space key or space name regex parameter to match on all attachments in the current space.
  • Use .*png to match on attachments whose name ends in PNG.

Macro browser input

Select this macro

Macro nameAdvanced Tables - Attachment table
Macro syntax (Old editor){attachment-table}
Macro syntax (New editor - case insensitive)/Attachment Table

Define these parameters/values

Space key or space name regex @self
Attachment name regex.*png

Confluence is more limited on parameter values. Thus, | (pipe - used for regex or) is a reserved character and cannot be used.

Parameters set in the macro editor

Wiki markup input (Old editor)

{attachment-table:spaceRegex=@self|attachmentRegex=.*png} 

Example result

Selecting attachments based on matching on more than one label

Constructing a regex to match attachments that have two or more specific labels is a bit more complicated. To do this, you must:

  1. Set the Label match option to all.
  2. Use a regex pattern similar to the following using xxx, yyy, and zzz as sample labels:
2 labels:  .*(?:.*\b(?:(?:xxx)|(?:yyy))\b.*){2}.*
3 labels:  .*(?:.*\b(?:(?:xxx)|(?:yyy)|(?:zzz))\b.*){3}.*

Other examples

Visit our full list of product examples for additional inspiration!



Find answers from the community.

Ask a question to the community.

Log a request with our support team.


Confluence®, Jira®, Atlassian Bamboo®, Bitbucket®, Fisheye®, and Atlassian Crucible® are registered trademarks of Atlassian®
Copyright © 2005 - 2022 Appfire | All rights reserved. Appfire™, the 'Apps for makers™' slogan and Bob Swift Atlassian Apps™ are all trademarks of Appfire Technologies, LLC.