blob: 5cd112fbe09ae688a4cd811cc0c8f260bc1a7ced [file] [log] [blame]
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"></meta><title>ExtractText</title><link rel="stylesheet" href="../../../../../css/component-usage.css" type="text/css"></link></head><script type="text/javascript">window.onload = function(){if(self==top) { document.getElementById('nameHeader').style.display = "inherit"; } }</script><body><h1 id="nameHeader" style="display: none;">ExtractText</h1><h2>Description: </h2><p>Evaluates one or more Regular Expressions against the content of a FlowFile. The results of those Regular Expressions are assigned to FlowFile Attributes. Regular Expressions are entered by adding user-defined properties; the name of the property maps to the Attribute Name into which the result will be placed. The attributes are generated differently based on the enabling of named capture groups. If named capture groups are not enabled: The first capture group, if any found, will be placed into that attribute name.But all capture groups, including the matching string sequence itself will also be provided at that attribute name with an index value provided, with the exception of a capturing group that is optional and does not match - for example, given the attribute name "regex" and expression "abc(def)?(g)" we would add an attribute "regex.1" with a value of "def" if the "def" matched. If the "def" did not match, no attribute named "regex.1" would be added but an attribute named "regex.2" with a value of "g" will be added regardless.If named capture groups are enabled: Each named capture group, if found will be placed into the attributes name with the name provided. If enabled the matching string sequence itself will be placed into the attribute name. If multiple matches are enabled, and index will be applied after the first set of matches. The exception is a capturing group that is optional and does not match For example, given the attribute name "regex" and expression "abc(?&lt;NAMED&gt;def)?(?&lt;NAMED-TWO&gt;g)" we would add an attribute "regex.NAMED" with the value of "def" if the "def" matched. We would add an attribute "regex.NAMED-TWO" with the value of "g" if the "g" matched regardless. The value of the property must be a valid Regular Expressions with one or more capturing groups. If named capture groups are enabled, all capture groups must be named. If they are not, then the processor configuration will fail validation. If the Regular Expression matches more than once, only the first match will be used unless the property enabling repeating capture group is set to true. If any provided Regular Expression matches, the FlowFile(s) will be routed to 'matched'. If no provided Regular Expression matches, the FlowFile will be routed to 'unmatched' and no attributes will be applied to the FlowFile.</p><p><a href="additionalDetails.html">Additional Details...</a></p><h3>Tags: </h3><p>evaluate, extract, Text, Regular Expression, regex</p><h3>Properties: </h3><p>In the list below, the names of required properties appear in <strong>bold</strong>. Any other properties (not in bold) are considered optional. The table also indicates any default values.</p><table id="properties"><tr><th>Display Name</th><th>API Name</th><th>Default Value</th><th>Allowable Values</th><th>Description</th></tr><tr><td id="name"><strong>Character Set</strong></td><td>Character Set</td><td id="default-value">UTF-8</td><td id="allowable-values"></td><td id="description">The Character Set in which the file is encoded</td></tr><tr><td id="name"><strong>Maximum Buffer Size</strong></td><td>Maximum Buffer Size</td><td id="default-value">1 MB</td><td id="allowable-values"></td><td id="description">Specifies the maximum amount of data to buffer (per file) in order to apply the regular expressions. Files larger than the specified maximum will not be fully evaluated.</td></tr><tr><td id="name">Maximum Capture Group Length</td><td>Maximum Capture Group Length</td><td id="default-value">1024</td><td id="allowable-values"></td><td id="description">Specifies the maximum number of characters a given capture group value can have. Any characters beyond the max will be truncated.</td></tr><tr><td id="name"><strong>Enable Canonical Equivalence</strong></td><td>Enable Canonical Equivalence</td><td id="default-value">false</td><td id="allowable-values"><ul><li>true</li><li>false</li></ul></td><td id="description">Indicates that two characters match only when their full canonical decompositions match.</td></tr><tr><td id="name"><strong>Enable Case-insensitive Matching</strong></td><td>Enable Case-insensitive Matching</td><td id="default-value">false</td><td id="allowable-values"><ul><li>true</li><li>false</li></ul></td><td id="description">Indicates that two characters match even if they are in a different case. Can also be specified via the embedded flag (?i).</td></tr><tr><td id="name"><strong>Permit Whitespace and Comments in Pattern</strong></td><td>Permit Whitespace and Comments in Pattern</td><td id="default-value">false</td><td id="allowable-values"><ul><li>true</li><li>false</li></ul></td><td id="description">In this mode, whitespace is ignored, and embedded comments starting with # are ignored until the end of a line. Can also be specified via the embedded flag (?x).</td></tr><tr><td id="name"><strong>Enable DOTALL Mode</strong></td><td>Enable DOTALL Mode</td><td id="default-value">false</td><td id="allowable-values"><ul><li>true</li><li>false</li></ul></td><td id="description">Indicates that the expression '.' should match any character, including a line terminator. Can also be specified via the embedded flag (?s).</td></tr><tr><td id="name"><strong>Enable Literal Parsing of the Pattern</strong></td><td>Enable Literal Parsing of the Pattern</td><td id="default-value">false</td><td id="allowable-values"><ul><li>true</li><li>false</li></ul></td><td id="description">Indicates that Metacharacters and escape characters should be given no special meaning.</td></tr><tr><td id="name"><strong>Enable Multiline Mode</strong></td><td>Enable Multiline Mode</td><td id="default-value">false</td><td id="allowable-values"><ul><li>true</li><li>false</li></ul></td><td id="description">Indicates that '^' and '$' should match just after and just before a line terminator or end of sequence, instead of only the beginning or end of the entire input. Can also be specified via the embeded flag (?m).</td></tr><tr><td id="name"><strong>Enable Unicode-aware Case Folding</strong></td><td>Enable Unicode-aware Case Folding</td><td id="default-value">false</td><td id="allowable-values"><ul><li>true</li><li>false</li></ul></td><td id="description">When used with 'Enable Case-insensitive Matching', matches in a manner consistent with the Unicode Standard. Can also be specified via the embedded flag (?u).</td></tr><tr><td id="name"><strong>Enable Unicode Predefined Character Classes</strong></td><td>Enable Unicode Predefined Character Classes</td><td id="default-value">false</td><td id="allowable-values"><ul><li>true</li><li>false</li></ul></td><td id="description">Specifies conformance with the Unicode Technical Standard #18: Unicode Regular Expression Annex C: Compatibility Properties. Can also be specified via the embedded flag (?U).</td></tr><tr><td id="name"><strong>Enable Unix Lines Mode</strong></td><td>Enable Unix Lines Mode</td><td id="default-value">false</td><td id="allowable-values"><ul><li>true</li><li>false</li></ul></td><td id="description">Indicates that only the '
' line terminator is recognized in the behavior of '.', '^', and '$'. Can also be specified via the embedded flag (?d).</td></tr><tr><td id="name"><strong>Include Capture Group 0</strong></td><td>Include Capture Group 0</td><td id="default-value">true</td><td id="allowable-values"><ul><li>true</li><li>false</li></ul></td><td id="description">Indicates that Capture Group 0 should be included as an attribute. Capture Group 0 represents the entirety of the regular expression match, is typically not used, and could have considerable length.</td></tr><tr><td id="name"><strong>Enable repeating capture group</strong></td><td>extract-text-enable-repeating-capture-group</td><td id="default-value">false</td><td id="allowable-values"><ul><li>true</li><li>false</li></ul></td><td id="description">If set to true, every string matching the capture groups will be extracted. Otherwise, if the Regular Expression matches more than once, only the first match will be extracted.</td></tr><tr><td id="name">Enable named group support</td><td>extract-text-enable-named-groups</td><td id="default-value">false</td><td id="allowable-values"><ul><li>true</li><li>false</li></ul></td><td id="description">If set to true, when named groups are present in the regular expression, the name of the group will be used in the attribute name as opposed to the group index. All capturing groups must be named, if the number of groups (not including capture group 0) does not equal the number of named groups validation will fail.</td></tr></table><h3>Dynamic Properties: </h3><p>Supports Sensitive Dynamic Properties: <strong>No</strong></p><p>Dynamic Properties allow the user to specify both the name and value of a property.<table id="dynamic-properties"><tr><th>Name</th><th>Value</th><th>Description</th></tr><tr><td id="name">A FlowFile attribute</td><td id="value">A Regular Expression with one or more capturing group</td><td>The first capture group, if any found, will be placed into that attribute name.But all capture groups, including the matching string sequence itself will also be provided at that attribute name with an index value provided.<br/><strong>Supports Expression Language: false</strong></td></tr></table></p><h3>Relationships: </h3><table id="relationships"><tr><th>Name</th><th>Description</th></tr><tr><td>unmatched</td><td>FlowFiles are routed to this relationship when no provided Regular Expression matches the content of the FlowFile</td></tr><tr><td>matched</td><td>FlowFiles are routed to this relationship when the Regular Expression is successfully evaluated and the FlowFile is modified as a result</td></tr></table><h3>Reads Attributes: </h3>None specified.<h3>Writes Attributes: </h3>None specified.<h3>State management: </h3>This component does not store state.<h3>Restricted: </h3>This component is not restricted.<h3>Input requirement: </h3>This component requires an incoming relationship.<h3>System Resource Considerations:</h3>None specified.</body></html>