Replace with the same searched word with RegExr including a new character

1

Alright? I have a doubt. I used the expression (\ d {2}. \ D {2}) as attached image to search the codes in this list of services.

I would like help Replace to occur with the same searched word plus the ; character at the beginning and end.

It will be of great value a solution for this case, it will help me a lot (Professional issues).

    
asked by anonymous 22.07.2018 / 22:30

1 answer

2

Put in the "Replace with" field the expression:

;$1;

The $1 represents the captured group and the ; characters will be added before and after it has been captured.

An example using JavaScript, but notepad ++ treats the same way:

var string = "humanos 04.19 bancos 12.34 e 13.6";
var re = new RegExp("(\d{2}.\d{2})", "g");
var resultado = string.replace(re , ";$1;");
console.log(resultado);
    
22.07.2018 / 22:46