Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

apache nifi replacetext processor - 'not a valid java regular expression' alert

Highlighted

apache nifi replacetext processor - 'not a valid java regular expression' alert

New Contributor

Hi! I've got my expression working in regexer.com. The goal is to remove all strings that start with '{"categoryid"' and end with '"},'

Expression: /({"categoryid")(.*?)("},)/gi

Text: {"categoryid":140,"categoryname":"Seasonal-Halloween"},

I'm using the 'replacetext' processor

  1. Replacement strategy: Regex Replace
  2. Evaluation Mode: Entire text

Although it works in regexr, I get this alert in the processor: 'not a valid java regular expression'.

Does anyone have any suggestions of how I can achieve my goal? Thanks!

110124-nifi-replacetext-processor-alert-1.jpg

110138-nifi-replacetext-processor-alert-2.jpg


2 REPLIES 2

Re: apache nifi replacetext processor - 'not a valid java regular expression' alert

Super Guru

@Joseph Patrick

Try with below regex:

Search Value

(\\{\"categoryid\")(.*?)(\"\\},)


Re: apache nifi replacetext processor - 'not a valid java regular expression' alert

New Contributor

Thanks for helping, @Shu! I now get this alert:

110221-nifi-replacetext-processor-alert-3.jpg

Don't have an account?
Coming from Hortonworks? Activate your account here