Hi,
I have come across an issue with my regex associated with
ReplaceTextWithMapping. I have attached input and mapping files together
with a NiFi template. My Json looks like this:

    {"field1": "someText",
      "field2": "Text Again",
      "field3": "Text Again"}

I am trying to match the first occurrence of a phrase starting with capital
letter and having a space in between words (in my case "Text Again"). This
is the regex I have ended up with:

("[A-Za-z]+\s[A-Za-z]+")

It should match the first "Text Again" as tested with the online tester
https://regex101.com/ and replace that with the value from the mapping file:

"Text Again" "New Text"

However, it does not pick either and the substitution is not applied. Is my
regex incorrect? Can you help?

Thank you so much for all your help,

I.

3c370620-54fb-4a38-b987-f87cc2f56493.template
<http://apache-nifi-developer-list.39713.n7.nabble.com/file/n10592/3c370620-54fb-4a38-b987-f87cc2f56493.template>
  

inputJson.json
<http://apache-nifi-developer-list.39713.n7.nabble.com/file/n10592/inputJson.json>
  

mapping_file.txt
<http://apache-nifi-developer-list.39713.n7.nabble.com/file/n10592/mapping_file.txt>
  




--
View this message in context: 
http://apache-nifi-developer-list.39713.n7.nabble.com/Issues-with-Regex-used-with-ReplaceTextWithMapping-where-am-I-going-wrong-tp10592.html
Sent from the Apache NiFi Developer List mailing list archive at Nabble.com.

Reply via email to