Create regular expressions as easy as a breeze. This node allows you to build, preview, and test your regexes in real time with your real data. Say good bye to creating your regex in KNIME with trial and error, or copying back and forth regular expressions and text between your favorite regex tool and KNIME. The user interface is inspired by RegExr and Regular Expressions 101.
The node uses Java’s Pattern
implementation. For each row or text input, it will extract all
matches. Each capturing group is automatically mapped to a KNIME
column. To define the column names, you can make use of
“named capturing groups”, such as
(?<name>[A-Z-a-z]+)
.
To exclude groups from the output, define them as “non-capturing group”: (?:)
.
Usage Example: Extract email addresses from text
For this input text: “Hello, world! mail@palladian.ai The
quick brown fox jumps over the lazy dog. bob@example.com Lorem
ipsum.” and the
\b(?<Local Part>[A-Z0-9._%+-]+)@(?<Domain>[A-Z0-9.-]+\.[A-Z]{2,})\b
,
the node will create a KNIME table as follows:
Full Match | Local Part | Domain |
---|---|---|
mail@palladian.ai | palladian.ai | |
bob@example.com | bob | example.com |
Standalone Mode
The node can be used with an input table, which provides a string column, or in “standalone” mode (when no input table is connected), where you can enter the text into the node dialog.
Further reading
For a general introduction into regular expressions, have a look at Regular-Expressions.info.
matches
array with all matches. Each
match
object contains a groups
array. A
group
has the properties start
, end
(offset within the input text), groupIdx
(running
index), and the value
.
$MATCHINDEX
for the index must
be used to avoid naming conflictsYou want to see the source code for this node? Click the following button and we’ll use our super-powers to find it for you.
To use this node in KNIME, install the extension Palladian for KNIME from the below update site following our NodePit Product and Node Installation Guide:
A zipped version of the software site can be downloaded here.
Deploy, schedule, execute, and monitor your KNIME workflows locally, in the cloud or on-premises – with our brand new NodePit Runner.
Try NodePit Runner!Do you have feedback, questions, comments about NodePit, want to support this platform, or want your own nodes or workflows listed here as well? Do you think, the search results could be improved or something is missing? Then please get in touch! Alternatively, you can send us an email to mail@nodepit.com.
Please note that this is only about NodePit. We do not provide general support for KNIME — please use the KNIME forums instead.