Forums

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

Does the source editor support subexpressions?

Jane Tatchell August 6, 2020

I need to edit a page that has a great many spurious embedded hyperlinks on class names. For example, com.mycompany.xx.MyClass has a hyperlink on the com.mycompany.xx package name.

I went into the source editor by clicking the <> button at the right end of the editor toolbar. (I'm not sure whether this is a standard feature of Confluence or a plugin that my company has purchased. :-( )

In any case, I've selected the Regex checkbox and entered the following in the Find field:

<a href=.+?>(.+?)</a>

This pattern finds and selects the full anchor string, exactly as I need, such as this one:

<a href="com.mycompany.xx">com.mycompany.xx</a>

However, putting the following in the Replace field:

\1

and then clicking Replace just replaces the selected text with:

\1

instead of:

com.mycompany.xx

Can someone help me with what the correct syntax is for using the subexpression in the Replace text?

1 answer

1 accepted

0 votes
Answer accepted
Bill Bailey
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.
August 7, 2020

I am a heavy user of the source editor (free plugin), and I have not been able to get that feature to work (annoying, to say the least). The plugin has only got updates to support new versions of Confluence over the last 7 years.

There is a commercial version that also supports RegEx but their documentation is poor, so not sure it has this feature either: source-editor-for-confluence 

Jane Tatchell August 10, 2020

Yeah, I read their docs too. :-(

Looks like I just have to accept doing the edits manually.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events