Regex expresion replace a field if pattern exists

Highlighted
One Star

Regex expresion replace a field if pattern exists

I am trying to find a solution using a tReplace where a string is contained in the original field and I want to replace the whole field with a new string. For example I would like to replace any string containing the word or pattern bolt with the word bolt.

original field
______________
hexbolt
3/4" bolt, stainless steel
boltpart

I know it is easy to change a single word with another word but I am looking for a solution to change the entire phrase. Has anyone been able to do this before and if so can you provide an example?

Thanks!
Highlighted
Community Manager

Re: Regex expresion replace a field if pattern exists

Hello friend
Sorry for a little delay!
To fit your request, you should use the advanced model on'Advanced settings' tab. I show you an example,
input file:

hexbolt
3/4" bolt, stainless steel
boltpart

I will replace 'bolt' with 'AAA' in the entire phrase.
result:
Starting job forum5924 at 10:04 24/03/2009.
hexAAA
3/4" AAA, stainless steel
AAApart
Job forum5924 ended at 10:04 24/03/2009. [exit code=0]

Best regards

shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
Highlighted
One Star

Re: Regex expresion replace a field if pattern exists

The question is actually how do you replace "hexbolt" with just "bolt"

2019 GARTNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

6 Ways to Start Utilizing Machine Learning with Amazon We Services and Talend

Look at6 ways to start utilizing Machine Learning with Amazon We Services and Talend

Blog

Downloads and Trials

Test drive Talend's enterprise products.

Downloads