[Info-vax] DCL and scripting

Arne Vajhøj arne at vajhoej.dk
Tue Dec 11 21:23:09 EST 2018


On 12/11/2018 7:55 PM, Craig A. Berry wrote:
> On 12/11/18 2:11 PM, Jairo Alves wrote:
>> $ str = "11-DEC-2018 17:24"
>> $ str = F$REGEX(str, "(\d{2})-(\w+)-(\d{4})", -
>>                  "$3_$2_$1", "UNGREEDY,CASE_INSENSITIVE")
> 
> I think your second parameter would have to be "''$3'_''$2'_''$1'"
> because to be really useful, the captured matches would need to be
> ordinary DCL symbols that would persist after the lexical call. And in
> that case, you probably really couldn't call them $1, $2, $3, etc.
> because that's going to conflict with existing usage somewhere.

Returning a single string as function result make perfect sense to me.

This is not F$REGEX_MATCH but F$REGEX_REPLACE.

>                                                               So,
> sorry to say, but they would probably need to be something like
> DCL$REGEX_MATCH_1, DCL$REGEX_MATCH_2, etc.

F$REGEX_MATCH would either have to set a bunch of symbols like
this.

Or have a context variable and make multiple calls to the
lexical similar to various F$GETXXX functions.

Arne




More information about the Info-vax mailing list