Hello,
This is a pretty simple problem to explain, and I was hoping someone can explain why this doesn't work. I have a bunch of regular expressions I'm trying to use regex_replace in the formula tool, as so:
Regex_replace([text], "regex expression 1", "replacement 1") OR
Regex_replace([text],"regex expression 2", "replacement 2")
However, regardless of what I put in the regex expression or replacement fields (it can be the simplest thing), all I get is "0" in the text column (which is a vstring). The only way around this is to make it a two step process and do a "if regex_match then regex_replace" type thing which requires two operations instead of one (this is going to be performed on millions of records, so speed is important).
Any guesses to why sticking the logical OR sign causes this to happen?
Hi, @theinsideguy
anyway, your formula Regex_replace([text], "regex expression 1", "replacement 1") OR Regex_replace([text],"regex expression 2", "replacement 2") only is a logic expression about "OR", so the result just is 0 or -1 .
If you want used both regex expressions, maybe you need REGEX_Match(String, pattern) first.
@theinsideguy , can you provide a sample dataset?
Also, if you could try this.
Another way around is to break the formula
Regex_replace([text], "regex expression 1", "replacement 1") OR
Regex_replace([text],"regex expression 2", "replacement 2")
into two different field.
Thanks!