How To search for specific Sourcecode?

Hello,

In Confluence I want to search for a specific part of the source Code of my page.

In fact I want to check IF this is part of my source Code:

<tr>  
    <th> USER </th>  
    <td>       
<div class="content-wrapper">   
       <p>         
   <br/>        
  </p>      
  </div>     
</td>   
</tr>

Source Code that Looks like this should not be detected : 

<tr> 
     <th> USER </th>  
    <td>      
  <div class="content-wrapper">     
     <p>     
       <ac:link>      
        <ri:user ri:userkey="xxxx"/>     
       </ac:link>  
        </p>      
  </div>   
   </td>
</tr>   

 Thanks!

1 answer

0 vote
Stephen Deutsch Community Champion Jan 25, 2018

I was going to suggest the Confluence Source Editor, but I found out that it doesn't support multi-line searches.

I think your best bet would be to click the "View Storage Format" option on the ••• menu and search that using something like Notepad++ that supports Regular Expression search. Then you could just search for something like 

<th>\s*USER\s*<\/th>\s*<td>\s*<div class="content-wrapper">\s*<p>\s*<br\/>\s*<\/p>

If you want to replace it with something else, you could do a search and replace and use the technique I wrote in this answer to change the source code:

https://community.atlassian.com/t5/Confluence-questions/Editing-Source-Code-in-Confluence/qaq-p/129384

However, this would only work for one page. If you want to do the search on multiple pages, then you might consider using the Confluence CLI app, which I believe also supports regex search.

Hello Stephen,

 

Thanks a lot for your Reply. Unfortunately, due to my bad description it is not applicable to my problem.

My aim is to Display all pages that have this "string of Code" in its source Code.

Best,

 

Paul

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Tuesday in Confluence

We want to see the templates you've created in Confluence!

Hi Community, Jessica here from the Confluence Product Marketing team!  July’s community challenge is all about sharing pictures  — and as an extension of our first post on what ...

461 views 19 9
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you