0

I have a lot of lines with mark like

/* 1 */
/* 2 */
....
/* 1000 */

I want to replace them by comma. I came up with a simple regex to use on Notepadd++

\/(.*?)\/

Works fine, but sometimes some lines has txt like this and matches the regex when should not

de produtos /  trazendo inputs qualitativos / estratégicos para a marca
------------^-------------------------------^----------------------

I am trying to use /* instead of just / but with no success!

Any suggestion?

2Fast4YouBR
  • 956
  • 1
  • 10
  • 22

2 Answers2

0

The following should do the work

\/\*[\d\s]+\*\/

It will match first opening comment, then either digit or space multiple times and then closing comment

Wiktor Stribiżew
  • 561,645
  • 34
  • 376
  • 476
Yassin Hajaj
  • 20,892
  • 9
  • 46
  • 83
0

To be able to match /* ... */ blocks, you may use this regex:

\/\*.*?\*\/

Since * is meta-character in regex, it needs to be escaped as well.

Also it is required to use lazy quantifier .*? to avoid matching across the blocks.

anubhava
  • 713,503
  • 59
  • 514
  • 593