Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents
minLevel1
maxLevel2
outlinefalse
typeflat
separatorpipe
printablefalse

Overview

This provides access to match values using regular expressions.

Typically, instances of 'Matcher' will be accessed via the 'match' and 'find' keys of the Text Supplier.

Details

Name:

Match Supplier

Prefix:

match(optional)

Supported Content:

Matchers

Provided By:

Reporting for Confluence

, from version 3

Status
colourBlue
titleFROM v3.1.0

Supported Keys

The following are the list List of keys which that this supplier will return returns a value for.

Key

Content Types

Return Type

Description

[default]/value

Match

Text

The full matched value, from 'start' to 'end'.

start

Match

Number

The zero-based index the pattern started matching on.

end

Match

Number

The zero-based index the pattern ended matching on.

groups

Match

List of Text

The list of capturing groups in the current match.

Info

This list is zero-based,

while

but the individual 'group X' keys are 1-based.

group count

Match

Number

The number of groups in the current match.

group [X]

Match

Text

The capturing group at the specified index.

Info

The first group is 1 for this key.

You can request group 0, but it will be equivalent to the 'value' key above.

pattern

Match

Text

The regular expression pattern used by this matcher.

This

will

only

work

works with results from Text Supplier

's

'match' key, not the 'find' key.

replace with [X]

Match

Text

Replaces the matched pattern with 'X'.

You can use '$' with a group number to keep a captured group from the pattern

.

e.g.:
  • 'replace with The $1 value'

.

replace all with [X]

Match

Text

(Since 3.2.0) Replaces

Replaces all occurrences of the pattern with 'X'.

Status
colourBlue
titleFrom v3.2.0

You can use '$' with a group number to keep a captured group from the pattern. Eg. 'replace with The $1 value'.

This

will

only

work

works reliably with results from Text Supplier

's

'match' key, not the 'find' key.

replace first with [X]

Match

Text

(Since 3.2.0) Replaces

Replaces the first occurrence of the pattern with 'X'.

Status
colourBlue
titleFrom v3.2.0

You can use '$' with a group number to keep a captured group from the pattern

.

e.g.:
  • 'replace with The $1 value'

.

This

will

only

work

works reliably with results from Text Supplier

's

'match' key, not the 'find' key.

Examples

Replace All

This will replace Replaces all occurrences of "," with "-".

{report-info:data:Text > text:match "," > match:replace all with "-"}

Replace Space

This will replace Replaces the first space " " with a ":". Note that the square brackets ([ ]) must be used here to indicate a single space character, or it will be trimmed out of existence. {report-info:data:Text > text:match "[ ]" > match:replace all with "-"}

The square brackets ([ ]) must be used to indicate a single space character, or it will be trimmed out of existence.