visual studio code – VSCode: Regex to ‘Replace in Files’ to replace several space + #

I have a bunch of files which have a specific line in which I need to do some find & replace (via VSCode function ‘Replace in Files’ (Ctrl+Shift+H)).

Imagine the following (as-is):

---
Created at: 2017-03-09
Last updated at: 2017-03-09
tags: #On-going #Future_Fixes
---

I would need the following (to-be):

---
Created at: 2017-03-09
Last updated at: 2017-03-09
tags:
  - On-going
  - Future_Fixes
---

Basically I need, in a list of files, to have in every line started with tags string, to replace all ‘ #’ by ‘\n – ‘

Find: (?<=tags:)\s#+
Replace by: \n -

What I get is:

---
Created at: 2017-03-09
Last updated at: 2017-03-09
tags:
  - On-going #Future_Fixes
---

So it seems to be running only on the first instance, but not for the following.

I am running the latest stable version of VSCode.

Can anyone share any insights that may help achieve the above to-be?

Thanks in advance.

Read more here: Source link