Quantcast
Channel: Data Preparation & Blending discussions
Viewing all articles
Browse latest Browse all 4999

Processing 100s of regex for string replacement

$
0
0

Folks,

 

I have a few hundred regular expressions with which to replace text in a field in a sequential fashion. One way might be to hardcode each regex into successive Expressions within a formula tool - but I don't know if a single formula tool can handle hundreds of expressions. And in any case this becomes quite laborious.

 

Or if there were a Find Replace tool that handled regexes, I might have conceivably used that...

 

Alternatively, I thought I might be able to parameterise the formula tool such that I can reuse it as many times as I want, each time inputting my desired regex (e.g. "\s+") into a parameter '<param>' and my desired replacement as <replace> and then having a single expression:

 

Regex_replace([myfield], <param>, <replace>)

 

Admittedly this is also laborious for hundreds of regex.

 

Any suggestions on parametrising? Or alternative approaches?


Viewing all articles
Browse latest Browse all 4999

Trending Articles