Hello!
I'm evaluating a metadata column for string like:
I have loaded a few rows of data that are from the source in this tester so you can see the string I'm attempting to extract.
http://rubular.com/r/NgVdZWFESP
The CTL in my reformat is as follows:
The
I've attempted using
How can I extract that string pattern into a metadata column as I'm attempting to do?
please let me know if I should update with more information or anything is unclear, thank you in advance.
I'm evaluating a metadata column for string like:
\d\d[\s-][A-Z\d]{2}[\s-][A-Z\d]{2}
I have loaded a few rows of data that are from the source in this tester so you can see the string I'm attempting to extract.
http://rubular.com/r/NgVdZWFESP
The CTL in my reformat is as follows:
if (matches($in.0.Address,".*\\d\\d[\\s-][A-Z\\d]{2}[\\s-][A-Z\\d]{2}.*") and contains(upperCase($in.0.Address),"ADD")) {
$out.0.RNT_LOCATION = ""; //matchGroups($in.0.Address,"\\d\\d[\\s-][A-Z\\d]{2}[\\s-][A-Z\\d]{2}")[0];
}
The
".*\\d\\d[\\s-][A-Z\\d]{2}[\\s-][A-Z\\d]{2}.*"
works fine, but when I try to use "\\d\\d[\\s-][A-Z\\d]{2}[\\s-][A-Z\\d]{2}"
as found in the matchGroups, in order to isolate the string pattern I want, it cannot find the regular expression in the string.I've attempted using
"\\d\\d[\\s-][A-Z\\d]{2}[\\s-][A-Z\\d]{2}"
in a filter as well to see if it can find the regular expression in the string or not but I'm having no success returning rows.How can I extract that string pattern into a metadata column as I'm attempting to do?
please let me know if I should update with more information or anything is unclear, thank you in advance.
-
Hi,
The best approach would be to use the find function instead of using match. You can utilize a Normalizer component or you can keep your Reformat component and edit your output metadata to be of container type list.
Please sign in to leave a comment.
Comments 1