{"title":"String Splitter (Regex)","nodeType":"Manipulator","id":"*KUuLa8QggcD_9C01","factoryName":"org.knime.base.node.preproc.regexsplit.RegexSplitNodeFactory","factoryId":"org.knime.base.node.preproc.regexsplit.RegexSplitNodeFactory","path":["Manipulation","Column","Split & Combine"],"owner":"knime","ownerAccountId":"account:team:b5f0848f-496d-4e6a-b869-fa3532248db7","description":"<p>This node splits the string content of a selected column into logical groups using regular expressions. A capturing group is usually identified by a pair of parentheses, whereby the pattern in such parentheses is a regular expression. Optionally, a group can be named. See <i>Pattern</i> for more information. For each input, the capture groups are the output values. Those can be appended to the table in different ways; by default, every group will correspond to one additional output column.</p>\n            \n            <p>A short introduction to groups and capturing is given in the <a href=\"https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html#cg\" rel=\"ugc nofollow noopener noreferrer\"> Java API </a> . Some examples are given below:</p>\n            \n            <h4>Parsing Patent Numbers</h4>\n            \n            <p>Patent identifiers such as &#34;US5443036-X21&#34; consisting of a (at most) two-letter country code (&#34;US&#34;), a patent number (&#34;5443036&#34;) and possibly some application code (&#34;X21&#34;), which is separated by a dash or a space character, can be grouped by the expression <tt>([A-Za-z]{1,2})([0-9]&#43;)[ \\-]?(.*$)</tt> . Each of the parenthesized terms corresponds to the aforementioned properties. For named output columns, we can add group names to the pattern:</p><ul><li><tt>(?&lt;CC&gt;[A-Za-z]{1,2})</tt> is now identified with &#34;CC&#34; in the output.</li><li><tt>(?&lt;patentNumber&gt;[0-9]&#43;)</tt> is now identified with &#34;patentNumber&#34;.</li><li><tt>[ \\-]?</tt> is and was never a capturing group so it remains unchanged.</li><li><tt>(?&lt;applicationCode&gt;.*$)</tt> is now identified with &#34;applicationCode&#34;.</li></ul>\n                    Named and unnamed groups can also be mixed in one pattern.\n\n            \n            \n            <h4>Strip File URLs</h4>\n            \n            <p>This is particularly useful when this node is used to parse the file URL of a file reader node (the URL is exposed as a flow variable and then exported to a table using a Variable to Table node). The format of such URLs is similar to &#34;file:c:\\some\\directory\\foo.csv&#34;. Using the pattern <tt>[A-Za-z]*:(.*[/\\\\])(?&lt;filename&gt;([^\\.]*)\\.(.*$))</tt> generates four groups: The first group identifies the directory and is denoted by <tt>(.*[/\\\\])</tt> . It consumes all characters until a final slash or backslash is encountered; in the example, this refers to &#34;c:\\some\\directory\\&#34;. The second group represents the file name, whereby it encapsulates the third and fourth group. The third group ( <tt>([^\\.]*)</tt> ) consumes all characters after the directory, which are not a dot &#39;.&#39; (which is &#34;foo&#34; in the above example). The pattern expects a single dot (final which is ignored) and finally the fourth group <tt>(.*$)</tt> , which reads until the end of the string and indicates the file suffix (&#39;csv&#39;). The groups for the above example are</p><ol><li>Group <i>1</i> : c:\\some\\directory</li><li>Group <i>filename</i> : foo.csv</li><li>Group <i>3</i> : foo</li><li>Group <i>4</i> : csv</li></ol>\n                \n            \n            \n            <h4>Email Address Extraction</h4>\n            \n            <p>Let&#39;s consider a scenario where you have a list of email addresses. Using the pattern <tt>(?&lt;username&gt;.&#43;)&#64;(?&lt;domain&gt;.&#43;)</tt> , you can extract the username and domain from the addresses. The groups for the email address &#34;john.doe&#64;example.com&#34; are:</p><ul><li>Group <i>username</i> : john.doe</li><li>Group <i>domain</i> : example.com</li></ul>\n                \n            \n            \n        \n        ","shortDescription":"Splits an input string (column) into multiple groups according to a regular expression.","keywords":["Regex Split","Extract","Regex","Pattern","Group","Capture"],"deprecated":false,"streamable":true,"tags":["Manipulation","Column","Split & Combine","Streamable"],"icon":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA3hpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2Jl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P+8iO2yOYKSxIGGATs5nQWgv09oJaEUS79Ln0qFAVH4EnMgBYNpQFWGQTHLFcICJp9CQw0E5+OfBceKEuB5PvUxElNP18tORcAoNfhvlSlMFlzuZZpcogYdRjIwImA0hDlA5ImJxNvY2L4JH0qGO2O+kunBYmG6DSL1RwCzAA0vlGF6FBecsAAAAASUVORK5CYII=","sinceVersion":"5.3.0","views":[],"inPorts":[{"objectClass":"org.knime.core.node.BufferedDataTable","color":"000000","dataType":"Table","optional":false,"name":"Data Table","description":"Input table with string column to be split."}],"outPorts":[{"objectClass":"org.knime.core.node.BufferedDataTable","color":"000000","dataType":"Table","optional":false,"name":"Input with split columns","description":"Input table with additional column(s) and potentially duplicated rows representing the pattern groups.See &#34;Output matched groups as&#34; for more details."}],"dynInPorts":[],"dynOutPorts":[],"additionalSiteInformation":{"url":"https://update.knime.com/analytics-platform/5.12","trusted":true,"enabledByDefault":true,"name":"KNIME Analytics Platform 5.12 Update Site","version":"5.12.0"},"dialog":[{"sectionName":"Options","fields":[{"name":"String column","description":"Choose the column containing the strings to split","optional":false},{"name":"Pattern","description":"Define a pattern according to which the input string will be split. The capture groups that are defined in this pattern will correspond to the output values. A group can be defined in one of two ways:\n<ul><li>For a named group, define <tt>(?&lt;groupName&gt;pattern)</tt> , where <tt>groupName</tt> is the name of the group and <tt>pattern</tt> can be replaced by any regular expression that should be matched. Note that group names need to start with a letter and may contain only letters and digits, no spaces.</li><li>For an unnamed capture group, simply use parenthesis around your pattern: <tt>(pattern)</tt> , where again <tt>pattern</tt> can be replaced by any pattern. Unnamed capture groups are simply identified by their position in the pattern string, and they are enumerated starting at 1.</li></ul>\nIf you want to use non-capturing groups, construct them with <tt>(?:pattern)</tt>","optional":false},{"name":"Case sensitive","description":"Specifies whether matching will distinguish between upper and lower case letters.\n<br />\nBy default, case-insensitive matching assumes that only characters in the US-ASCII charset are being matched. Unicode-aware case-insensitive matching can be enabled by enabling <i>Unicode-aware case folding</i> .\n<br />\nMatching case-insensitive may impose a slight performance penalty.","optional":false},{"name":"Require whole string to match","description":"If enabled, the provided pattern must match the whole string in order to return any results. Otherwise, the first match in the input string is used.","optional":false},{"name":"If pattern does not match","description":"Define what to do if a pattern can&#39;t be matched to the input string:\n<ul><li><i>Insert missing value</i> puts missing cell(s) in place of the output column(s). The node will emit a warning when an input string doesn&#39;t match.</li><li><i>Insert empty string</i> puts empty string(s) in place of the output column(s). The node will emit a warning when an input string doesn&#39;t match.</li><li><i>Fail</i> causes the node to fail if one of the inputs can not be matched against the pattern.</li></ul>","optional":false},{"name":"Enable Unix lines mode","description":"In this mode, only the &#39;\\n&#39; line terminator is recognized in the behavior of ., ^, and $.","optional":false},{"name":"Enable multiline mode (^ and $ match at the beginning / end of a line)","description":"In multiline mode the expressions ^ and $ match just after or just before, respectively, a line terminator or the end of the input sequence. By default these expressions only match at the beginning and the end of the entire input sequence.","optional":false},{"name":"Enable dotall mode (Dot . also matches newline characters)","description":"In dotall mode, the expression . matches any character, including a line terminator. By default this expression does not match line terminators.","optional":false},{"name":"Enable Unicode-aware case folding","description":"When this is enabled then case-insensitive matching, when enabled, is done in a manner consistent with the Unicode Standard. By default, case-insensitive matching assumes that only characters in the US-ASCII charset are being matched.\n<br />\nEnabling this may impose a performance penalty.","optional":false},{"name":"Enable canonical equivalence","description":"When enabled, two characters will be considered to match if, and only if, their full canonical decompositions match. The expression &#34;a\\u030A&#34;, for example, will match the string &#34;\\u00E5&#34; when this is enabled. By default, matching does not take canonical equivalence into account.","optional":false},{"name":"Enable Unicode character classes","description":"When enabled, the (US-ASCII only) <i>Predefined character classes</i> and <i>POSIX character classes</i> are in conformance with the Unicode Standard.\n<br />\nEnabling this may impose a performance penalty.","optional":false},{"name":"Start group index counting from zero","description":"If enabled, the indices of non-named capturing groups start at zero instead of one. This setting is not meant to be manually enabled, but exists solely for the purpose of backwards-compatibility. Earlier versions of this node have this enabled to reflect how the node used to behave.","optional":false},{"name":"Output matched groups as","description":"Define how to output the results:\n<ul><li><i>Columns</i> : Each capture group in the defined pattern creates a new column in the output table. The column names correspond to the names of the named capture groups.</li><li><i>Rows</i> : Each input row is duplicated by the number of capture groups, and every capture is added to one of those copies.</li><li><i>List</i> : The captures are appended to the input as a list of strings.</li><li><i>Set (remove duplicates)</i> : The captures are appended to the input as a set of strings. Note that duplicates are removed and the order of captures is not preserved.</li></ul>","optional":false},{"name":"Output column prefix","description":"Define what prefix should be used for the output column names:\n<ul><li><i>Input column name</i> : The name of the column containing the string to split is used as a prefix.</li><li><i>Custom</i> : Define a custom string that shall be used as a prefix.</li><li><i>None</i> : No prefix is added.</li></ul>","optional":false},{"name":"Custom prefix","description":"Define a custom column prefix.","optional":false},{"name":"Output column","description":"Choose whether to append the output column or replace the input column.","optional":false},{"name":"Output column name","description":"Choose a name for the output column","optional":false},{"name":"Group labels in output","description":"Define the naming of the output groups:\n<ul><li><i>Capture group names or indices</i> : Use the names of the capture groups. For unnamed capture groups, their index is used as their label.</li><li><i>Split input column name</i> : Apply the provided pattern to the name of the input column and use the captures as labels.</li></ul>\nThe impact of this setting depends on the selected <i>Output mode</i> :\n<ul><li><i>Columns</i> : The labels will be used as the suffix of the column names.</li><li><i>Rows</i> : The labels will be used as the suffix of the row IDs.</li><li><i>List</i> and <i>Set</i> : The labels will be used as element names in the collection cell specification.</li></ul>","optional":false},{"name":"Remove input column","description":"Remove the input column from the output table.","optional":false}]}],"links":[],"kudos":[],"kudosCount":0,"bundleInformation":{"bundleVersion":"5.12.0.v202606261225","bundleName":"KNIME Base Nodes","bundleSymbolicName":"org.knime.base","bundleVendor":"KNIME AG, Zurich, Switzerland","featureSymbolicName":"org.knime.features.base","featureName":"KNIME Base nodes","featureVersion":"5.12.0.v202606261225","featureVendor":"KNIME AG, Zurich, Switzerland","extensionId":"*bjR3r1yWOznPIEXS"},"frequentSuccessors":[{"id":"*PHWv6FsABEjrSc76","factoryName":"org.knime.base.node.preproc.rename.RenameNodeFactory","probability":0.1395045632333768},{"id":"*DOkyMaii62U05xZ1","factoryName":"org.knime.base.node.preproc.filter.column.DataColumnSpecFilterNodeFactory","probability":0.09778357235984354},{"id":"*eOn8ibZnxIkY7XhT","factoryName":"org.knime.base.node.preproc.stringmanipulation.StringManipulationNodeFactory","probability":0.07953063885267275},{"id":"*5stmXk6zY_ORA4bC","factoryName":"org.knime.base.node.preproc.groupby.GroupByNodeFactory","probability":0.048239895697522815},{"id":"*KUuLa8QggcD_9C01","factoryName":"org.knime.base.node.preproc.regexsplit.RegexSplitNodeFactory","probability":0.04563233376792699},{"id":"*jd2U-FYTI8jCbQls","factoryName":"org.knime.base.node.preproc.filter.row.RowFilterNodeFactory","probability":0.04432855280312908},{"id":"*ZgYyOm1P9VJVBE9e","factoryName":"org.knime.base.node.preproc.joiner.Joiner2NodeFactory","probability":0.04041720990873533},{"id":"*C-nR3bKHp4paQHZK","factoryName":"org.knime.base.node.preproc.filter.row.RowFilter2PortNodeFactory","probability":0.03129074315514994},{"id":"*20rIDLuYXD4U8cnN","factoryName":"org.knime.base.node.preproc.colconvert.stringtonumber.StringToNumberNodeFactory","probability":0.03129074315514994},{"id":"*IPAOkJNeJy0B8rPZ","factoryName":"org.knime.base.node.preproc.cellsplit.CellSplitterNodeFactory","probability":0.024771838331160364}]}
