Support Questions
Find answers, ask questions, and share your expertise

Hi, where can i find the rules of nifi's regex language ?

 
1 ACCEPTED SOLUTION

Java reference : https://docs.oracle.com/javase/7/docs/api/java/util/regex/Pattern.html

\d stands for a digit [0-9] and + means at least one digit.

.* means any characters

View solution in original post

8 REPLIES 8

Hi @Thierry Vernhet

NiFi is using Java regular expressions.

Personally, I am using http://regexr.com/ to check my regular expressions.

+1 for the RegexR - i wrote some more complex expressions with it, it has a great interactive and visual explainer to help you out as you progress. The final expression can be copied as is from there into NiFi, no special escapes needed, etc.

Explorer

Does regexr.com validates if your Nifi expression is valid as well?

Thanks. I'm a novice nifi's user.

I've got in a "extract text" processor this property "grok" below.

grok

Info
^((?<year>\d+).*)$
And I don't understand exactly what it means and espacially "\d+" and ".*"

Check out http://regexr.com/ CheatSheet and Examples menu item on the left.

Java reference : https://docs.oracle.com/javase/7/docs/api/java/util/regex/Pattern.html

\d stands for a digit [0-9] and + means at least one digit.

.* means any characters

I find nifi regex to have less options. The same regex ( [\.]conf ) in my case to find a configuration file works from outside Nifi.

But on putting this pattern in Nifi ListHDFS processor , File Pattern will not match and the file is never pulled.

Any idea why this would happen ?

New Contributor

Hi, personally I am using https://www.debuggex.com/ and https://extendsclass.com/regex-tester.html to check regex.

Take a Tour of the Community
Don't have an account?
Your experience may be limited. Sign in to explore more.