Skip to main content

Hello,

 

 

I have an attribute that has values like this (the attribute itself is RegEX expression):

^>1-9]{1}10-9]{1-3}31-9]{1}10-9]{5-7}$

In this attribute I want to replace all - that are within {} with a ,

 

 

I tried using the String replacer by first selecting all curly brackets with dashes, like this :

\\{\\d-\\d\\}

And then replacing it with this:

\\{\\d,\\d\\}

But of course it does not work cause you cannot replace with regex.

 

 

Any ideas?

 

 

Thanks !

 

I guess you want to replace all dashes which are in the curly brackets with "," (comma).

You can use the expression below:

(?<=\{\d)\-

0684Q00000ArJlNQAV.jpg


@draganasubotic1

You can use stringreplacer, Replace Regular Expression.

regexp:

({[\\d])-([\\d]})

and replacement

\\1,\\2

Everything between brackets is a capture, of which there are 2 in this case.

Captures can be referred to by slashes, \\1 is first capture.


Thanks a lot, both answers were very helpful!


Reply