TestProject Forum

How do I replace a substring in a sales account number?

Hi,
How can i delete 4 digits on the account number in a form and replace those 4 digits with a new 4 digit number.

1 Like

Hello @sahanijuttukon
Can you give an example of such a string?
What is the input and what is the output that you need?

I need to replace the highlighted 4 zeros with a 4 digit number 1234

Hey,
You can use Replace substrings with regex action - \W\d{4}\W


Please let me know if you need more help.

1 Like

Hi @kfir.yosef Thanks for your recommendation, i tried as above, i am able to change 4 zeros with β€˜1234’ but now i have another problem, this code is replacing other 4 zeros also with β€˜1234’. I need to replace this value at one position only but this code replaces at two places.

I need this
image

But the code is doing this
image

I need this

But the above code is doing this

Hey,
Try this one: (\W\d{4}\W)[0]

Thanks @kfir.yosef this worked for me.
Can you help me fix other issue as well. I need to Hold Ctrl key on my keyboard and select multiple Lines and then click on β€œActions” button, how can i do this.
image

Hey @sahanijuttukon
You can use Press and hold key


You can see the following example:
JEARUqaD1l

1 Like