Support Questions

Find answers, ask questions, and share your expertise

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

Super Guru

@Joseph Patrick

Try with below regex:

Search Value

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


New Contributor

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

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