You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 31, 2021. It is now read-only.
<summary>Filters each <keywordtag="line">line</keyword> in a <glossarytag="container">container</glossary>, removing the <keywordtag="lines">lines</keyword> that do or don't match a pattern.</summary>
44
+
<summary>Filters each <keywordtag="line">line</keyword> or <keywordtag="item">item</keyword> in a source <glossarytag="container">container</glossary> or <glossarytag="expression">expression</glossary>, removing the <keywordtag="lines">lines</keyword> or <keywordtag="lines">items</keyword> that do or don't match a pattern.</summary>
44
45
<examples>
45
46
<example>filter myVariable with "A?2"</example>
46
47
<example>filter me without "*[a-zA-Z]*"</example>
47
48
<example>filter field 22 with "[0-9]*"</example>
48
49
<example>filter field "Sorted Lines" with "[" & mySelection & "]"</example>
50
+
<example>filter items of theList matching regex pattern "b.*"</example>
51
+
<example>filter items of theList with wildcard pattern "b*" into theFilteredList</example>
52
+
<example>filter lines of (theFirstList & return & theSecondList) not matching "b*"</example>
53
+
<example>
49
54
</examples>
50
55
<description>
51
-
<p>Use the <b>filter</b> command to pick specific <keyword tag="lines">lines</keyword> in a <glossary tag="container">container</glossary>.</p><p/><p><b>Parameters:</b></p><p>The <i>container</i> is any <glossary tag="expression">expression</glossary> that <glossary tag="evaluate">evaluates</glossary> to a <glossary tag="container">container</glossary>.</p><p/><p>The <i>filterPattern</i> is an expression used to match certain <keyword tag="lines">lines</keyword>.</p><p/><p><b>Comments:</b></p><p>The filter...with form places the lines that contain a match for the specified <i>filterPattern</i> in the <i>container</i>, replacing the previous contents.</p><p/><p>The filter...without form places the lines that do not contain a match for the specified <i>filterPattern</i> in the <i>container</i>, replacing the previous contents.</p><p/><p>A <i>filterPattern</i> consists of a string of characters to match which may be combined with any number of the following special characters:</p><p/><p><b>*</b></p><p>Matches zero or more of any character. The <i>filterPattern</i> A*C matches "AC", "ABC", or "ADZXC".</p><p/><p><b>?</b></p><p>Matches exactly one character. The <i>filterPattern</i> A?C matches "ABC", but not "AC" or "ADZXC".</p><p/><p><b>[<i>chars</i>]</b></p><p>Matches any one of the characters inside the brackets. The <i>filterPattern</i> A[BC]D matches "ABD" or "ACD", but not "AD" or "ABCD".</p><p/><p><b>[<i>char</i>-<i>char</i>]</b></p><p>Matches any character whose ASCII value is between the first character and the second character.</p><p/><p><b>Changes:</b></p><p>The filter...without form was added in version 2.1.1. In previous versions, the <b>filter</b> <glossary tag="command">command</glossary> could be used only to retrieve <keyword tag="lines">lines</keyword> that matched a <glossary tag="wildcard">wildcard expression</glossary>.</p>
56
+
<p>Use the <b>filter</b> command to pick specific <keyword tag="lines">lines</keyword> or <keyword tag="items">items</keyword> in a <glossary tag="container">container</glossary> or <glossary tag="expression">expression</glossary>.</p><p/><p><b>Parameters:</b></p><p>The <i>container</i> is any <glossary tag="expression">expression</glossary> that <glossary tag="evaluate">evaluates</glossary> to a <glossary tag="container">container</glossary>.</p><p/><p>The <i>filterPattern</i> is an expression used to match certain <keyword tag="lines">lines</keyword> or <keyword tag="items">items</keyword>.</p><p/><p><b>Comments:</b></p><p>The filter...with form and the filter...matching form retain the lines or items that contain a match for the specified <i>filterPattern</i>.</p><p/><p>The filter...without form and the filter...not matching form discard the lines or items that do not contain a match for the specified <i>filterPattern</i>.</p><p/><p>A <glossary tag="wildcard">wildcard</glossary> <i>filterPattern</i> consists of a string of characters to match which may be combined with any number of the following special characters:</p><p/><p><b>*</b></p><p>Matches zero or more of any character. The <i>filterPattern</i> A*C matches "AC", "ABC", or "ADZXC".</p><p/><p><b>?</b></p><p>Matches exactly one character. The <i>filterPattern</i> A?C matches "ABC", but not "AC" or "ADZXC".</p><p/><p><b>[<i>chars</i>]</b></p><p>Matches any one of the characters inside the brackets. The <i>filterPattern</i> A[BC]D matches "ABD" or "ACD", but not "AD" or "ABCD".</p><p/><p><b>[<i>char</i>-<i>char</i>]</b></p><p>Matches any character whose ASCII value is between the first character and the second character.</p><p/><p><b>Changes:</b></p><p>The filter...without form was added in version 2.1.1. In previous versions, the <b>filter</b> <glossary tag="command">command</glossary> could be used only to retrieve <keyword tag="lines">lines</keyword> that matched a <glossary tag="wildcard">wildcard expression</glossary>.</p><p>The filter items... form was added in version 6.1. In previous versions, the <b>filter</b> <glossary tag="command">command</glossary> could be used only to retrieve <keyword tag="lines">lines</keyword>.</p><p>The ability to filter using a <glossary tag="regular expression">regular expression</glossary> was added in version 6.1. In previous versions, the <b>filter</b> <glossary tag="command">command</glossary> only supported <glossary tag="wildcard">wildcard expressions</glossary>.</p><p>The ability to filter an <glossary tag="expression">expression</glossary> was added in version 6.1. In previous versions, the <b>filter</b> <glossary tag="command">command</glossary> could be used only for a <glossary tag="container">container</glossary>.</p><p>The filter...[not] matching form was added in version 6.1 to clarify the pattern handling.</p><p>The filter...into form was added in version 6.1. In previous versions, the <b>filter</b> <glossary tag="command">command</glossary> always replaced the contents of the original <glossary tag="container">container</glossary>.</p>
<summary>Removes <glossarytag="element">elements</glossary> from an <glossarytag="array">array</glossary> if they have no corresponding <keywordtag="element">element</keyword> in another <glossarytag="array">array</glossary>.</summary>
39
40
<examples>
40
41
<example>intersect myArray with the templateData of this stack</example>
42
+
<example>intersect myArray with theTemplate recursively</example>
41
43
</examples>
42
44
<description>
43
-
<p>Use the <b>intersect</b> <glossary tag="command">command</glossary> to filter out <glossary tag="element">elements</glossary> from an <glossary tag="array">array</glossary> according to the contents of another <glossary tag="array">array</glossary>.</p><p/><p><b>Parameters:</b></p><p>The <i>array</i> is any <glossary tag="array">array</glossary> <glossary tag="variable">variable</glossary>.</p><p/><p>The <i>templateArray</i> is any <glossary tag="array">array</glossary> <glossary tag="variable">variable</glossary>.</p><p/><p><b>Comments:</b></p><p>Each key of the <i>array</i> is checked to see whether there is a matching <glossary tag="key">key</glossary> in the <i>templateArray</i>. The <glossary tag="element">elements</glossary> of <i>array</i> that do not match an <keyword tag="element">element</keyword> of the <i>templateArray</i> are removed from the <i>array</i>.</p><p/><p>The content of individual elements of the <i>templateArray</i> does not affect the final result. Only which <glossary tag="element">elements</glossary> exist in the <i>templateArray</i>, not their content, controls which <glossary tag="element">elements</glossary> of the <i>array</i> are retained and which are removed. If the <i>array</i> and <i>templateArray</i> have the same set of <glossary tag="element">elements</glossary> but different content in each <keyword tag="element">element</keyword>, the <b>intersect</b> <glossary tag="command">command</glossary> does not change the value of the <i>array</i>.</p>
45
+
<p>Use the <b>intersect</b> <glossary tag="command">command</glossary> to filter out <glossary tag="element">elements</glossary> from an <glossary tag="array">array</glossary> according to the contents of another <glossary tag="array">array</glossary>.</p><p/><p><b>Parameters:</b></p><p>The <i>array</i> is any <glossary tag="array">array</glossary> <glossary tag="variable">variable</glossary>.</p><p/><p>The <i>templateArray</i> is any <glossary tag="array">array</glossary> <glossary tag="variable">variable</glossary>.</p><p>The <i>recursively</i> adverb indicates that the intersect should recurse through nested arrays.</p><p/><p><b>Comments:</b></p><p>Each key of the <i>array</i> is checked to see whether there is a matching <glossary tag="key">key</glossary> in the <i>templateArray</i>. The <glossary tag="element">elements</glossary> of <i>array</i> that do not match an <keyword tag="element">element</keyword> of the <i>templateArray</i> are removed from the <i>array</i>.</p><p/><p>The content of individual elements of the <i>templateArray</i> does not affect the final result. Only which <glossary tag="element">elements</glossary> exist in the <i>templateArray</i>, not their content, controls which <glossary tag="element">elements</glossary> of the <i>array</i> are retained and which are removed. If the <i>array</i> and <i>templateArray</i> have the same set of <glossary tag="element">elements</glossary> but different content in each <keyword tag="element">element</keyword>, the <b>intersect</b> <glossary tag="command">command</glossary> does not change the value of the <i>array</i>.</p>
0 commit comments