(I forgot to ask whether the LOCALE command affects the interpretation
of metacharacters in SYSIN. And to note that the Guide's using a
proportional-spaced font makes syntax runes and examples confusing.)
On Wed, 31 Aug 2022 10:21:42 -0500, Walt Farrell wrote:
>On Wed, 31 Aug 2022 10:03:21 -0500, Paul Gilmartin wrote:
>
>>
>>"[^abc]" matches any string containing a character
>>other than a, b, or c. It matches "wombat". However,
>>"^[^abc]*$" matches strings containing no character
>>other than a, b, or c. It does not match "wombat".
>
>Was that something you said, or something you're quoting from the manual? I'm
>not sure.
>
That;s what I said. The passage in z⧸OS DFSORT Application Programming Guide
which I quoted and you trimmed was:
Also, in a table:
The caret symbol, when inside square brackets,
negates the characters within the square brackets.
Thus [^abc], if compared to other strings, would fail
to match any that contains even one a, b, or c.
Further on:
The following patterns are given as examples, along with descriptions of
what they match:
abc Matches any record containing the three letters abc in that order.
Correct. "containing" because it's unanchored.
a.c Matches any string beginning with the letter a, followed by any
character, followed by the letter c.
Incorrect. It's unanchored. "beginning with" should be "containing".
(But is there a nice distinction between "record containing" and
"string beginning with" of which I'm unaware. Are those terms defined
and distinguished?)
>In any case, "[^abc]" does not match "wombat". It matches only a single
>character of a string. So, it might match the "w" in "wombat", or the "o", or
>the "m", or the "t", depending on other details of the input string being
>processed, and the application doing the processing.
>
Absent an anchor ("^" and/or "$") a pattern can be matched anywhere in a
subject.
>I agree with your comment (which I omitted from my quote) that the DFSORT
>books should not try to explain reg-ex processing, unless they have written
>their own processor instead of reusing someone else's.
>
+1
But it might be proper to emphasize any difference between DFSORT's use of
reg-ex and traditional beliefs.
--
Thanks,
gil
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN