[Info-vax] DCL and scripting
Jan-Erik Söderholm
jan-erik.soderholm at telia.com
Wed Dec 12 08:42:44 EST 2018
Den 2018-12-12 kl. 14:30, skrev Simon Clubley:
> On 2018-12-12, Dave Froble <davef at tsoft-inc.com> wrote:
>> On 12/11/2018 9:20 PM, Arne Vajhøj wrote:
>>> On 12/11/2018 3:11 PM, Jairo Alves wrote:
>>>>> F$REGEX_MATCH would not be that difficult.
>>>>
>>>> Suggestion:
>>>>
>>>> F$REGEX(input_string, regex_query, output_rule, modifiers)
>>>>
>>>> For example:
>>>>
>>>> $ str = "11-DEC-2018 17:24"
>>>> $ str = F$REGEX(str, "(\d{2})-(\w+)-(\d{4})", -
>>>> "$3_$2_$1", "UNGREEDY,CASE_INSENSITIVE")
>>>>
>>>> $ wr sys$output str
>>>> "2018_DEC_11"
>>>
>>> I think this is really F$REGEX_REPLACE.
>>
>> Not casting a handful of mud and such at anyone, but that is ugly, and
>> at least for me giberish. I don't want to even try to understand it.
>>
Even if it started as a tool on some Unix environment, today it has
become more of a standard.
On VMS it doesn't have to be part of DCL in itself, there is regex
support on tools like awk and perl, and in more modern scripting
languages like Python. If you are in the need of regex processing,
you are also doing some other more complex processing where a more
capable tool (than DCL) can be handy.
>
> $ set response/mode=good_natured
>
> Nice to see you are as predictable as always. :-)
>
> I wondered what you would say when you saw the above example of a regex. :-)
>
> However, once you get used to them, a regex is a _very_ powerful
> pattern matching tool and I don't have any problems understanding
> what the above example is trying to say.
>
> Simon.
>
More information about the Info-vax
mailing list