From: Jeff H. <Je...@Je...> - 2020-06-28 21:54:34
|
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> </head> <body> <p>This is purely match/select. I had not thought of a change, but it could be done, like CHANGE stage. On first thought, I think it would be good to have it a separate stage, there is a need for each.</p> <p>Here is the test file demonstrating it:</p> <p> <blockquote type="cite"><tt>/** regex<br> <br> >>--REGEX--+--------------------------+--regex_string-(1)---><<br> +-(--| options_string |--)-+<br> <br> options_string:<br> |--+---------+--|<br> +-NUMBERS-+ (2)<br> <br> <br> Records matching the RegEx are put out on primary output<br> Records not matching are put out on secondary, if connected, or discarded.<br> <br> (1) string is a Java RegEx expresion. null string passes all records.<br> (2) lines are prefaced with line number, 10 characters, right justified<br> <br> [Possible future options: BEFORE and AFTER, etc., to give context, ala GREP.]<br> <br> */<br> <br> /*<br> 20/ 6/28 Jeff Hennick<br> */<br> <br> pipe (regex_tests01)<br> <br> o: faninany |<br> sort singleok |<br> specs 2-* 1 |<br> cons ?<br> <br> -- regex ?<br> literal a1a a2b a3c d4d e5e f6f g7g|<br> split |<br> regex c$ |<br> c1: compare any ~2# 1 regex ~ equal ~*OK*~ notequal ~**FAIL** at rec \\c col \\b.~ less /Less:\nActual:\n\\p\nExpected:\n\\s\n/ more /More:\nActual:\n\\p\nExpected:\n\\s\n/ |<br> o: ?<br> literal a3c |<br> split ; |<br> c1: ?<br> <br> -- numbers regex ?<br> literal a1a a2b a3c d4d e5e f6f g7g|<br> split |<br> regex (numbers) c$ |<br> c2: compare any ~2# 2 numbers regex ~ equal ~*OK*~ notequal ~**FAIL** at rec \\c col \\b.~ less /Less:\nActual:\n\\p\nExpected:\n\\s\n/ more /More:\nActual:\n\\p\nExpected:\n\\s\n/ |<br> o: ?<br> literal 3a3c |<br> split ; |<br> c2: ?<br> <br> -- numbers (secondary) ?<br> literal a1a a2b a3c d4d e5e f6f g7g|<br> split |<br> t3: regex (numbers) c$ |<br> hole ?<br> t3: |<br> c3: compare any ~2# 3 numbers (secondary) ~ equal ~*OK*~ notequal ~**FAIL** at rec \\c col \\b.~ less /Less:\nActual:\n\\p\nExpected:\n\\s\n/ more /More:\nActual:\n\\p\nExpected:\n\\s\n/ |<br> o: ?<br> literal 1a1a; 2a2b; 4d4d; 5e5e; 6f6f; 7g7g |<br> split ; |<br> c3: ?<br> </tt></blockquote> Jeff<br> </p> <div class="moz-cite-prefix">On 6/28/2020 4:35 PM, Colin wrote:<br> </div> <blockquote type="cite" cite="mid:00a...@im..."> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <font face="Century Gothic">I like the idea! <br> <br> So initially it looks like this is purely for pattern matching. Will a future enhancement allow modifying via a regex as well?<br> <br> Cheers<br> Colin K</font> </blockquote> </body> </html> |