Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

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

avatar
Rising Star
 
1 ACCEPTED SOLUTION

avatar

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

avatar

Hi @Thierry Vernhet

NiFi is using Java regular expressions.

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

avatar

+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.

avatar
Explorer

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

avatar
Rising Star

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 ".*"

avatar

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

avatar

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

avatar
Contributor

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 ?

avatar
New Contributor

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