Skip to main content
Nintex Community Menu Bar

How to replace a string contains in another string using regular expression

  • February 7, 2018
  • 5 replies
  • 50 views

Forum|alt.badge.img+5

Hi everyone,

I have a to be replaced text in this format: "dd ame". I want to replace this text in a multiline field using regular expression. 

Tried different things like "dd\name" or "dd/ ame" or "dd*\\"" in pattern and still couldn't figure that out.

Does anybody have an idea?

Thanks!

5 replies

Forum|alt.badge.img+14
  • Scholar
  • February 7, 2018

what about this pattern?

w+\w+

213282_pastedImage_1.png


Forum|alt.badge.img+5
  • Author
  • February 8, 2018

Thanks Martin,

The pattern works perfectly for replacing but how can I tell to replace before and after words if they're matched?

here is the example if signer = nassafari => Replace nassafari with "Replaced".

if signer = aamhatala => Replace  aamhatala with "Replaced".

213297_pastedImage_1.png

Thanks


Forum|alt.badge.img+14
  • Scholar
  • February 8, 2018

I'm not sure I understand what you mean.

the pattern I suggested replaces any two consecutive words split by single backslash. do you mean to replace only exact string pattern? so eg if there appear nassafari in the text then replace it, but if there appears eg. anssafari then do not replace it?

if so, then your pattern simply should look like

na\ssafari

213312_pastedImage_1.png


Forum|alt.badge.img+5
  • Author
  • February 8, 2018

I figured that out,

na\ssafari will replace nassafari in a string.


Forum|alt.badge.img+14
  • Scholar
  • February 8, 2018

great!

if you've got a solution please mark question answered.