Created on 05-02-2019 02:20 PM - edited 09-16-2022 07:21 AM
I'm trying to use regex to match the line:
# DOG CAT BIRD
NiFi regex seems to treat # as a comment character, whereas other regexes do not.
How do I match the literal character # in a string with regex?
The doc page https://nifi.apache.org/docs/nifi-docs/html/expression-language-guide.html#escaping doesn't seem to help me out here.
Created 05-02-2019 03:25 PM
You can ignore the unexpected coloring rendered by the NiFi Expression language editor window.
The java regex replace should work just using "# DOG CAT BIRD" or "\# DOG CAT BIRD".
Thank you,
Matt
Created 05-02-2019 02:54 PM
Did you try using '\' character?
Created on 05-02-2019 02:59 PM - edited 08-17-2019 03:39 PM
With the '\' character, the '#' character still highlights the text after it as a comment:
Created 05-02-2019 03:25 PM
You can ignore the unexpected coloring rendered by the NiFi Expression language editor window.
The java regex replace should work just using "# DOG CAT BIRD" or "\# DOG CAT BIRD".
Thank you,
Matt
Created 05-02-2019 04:45 PM
Thanks Matt, I didn't realize that the colored text was not a comment in this case.