[Info-vax] OpenVMS - DCL - Data entry filtering

Craig A. Berry craigberry at nospam.mac.com
Thu Mar 26 17:57:23 EDT 2015


On 3/26/15 4:14 PM, mcleanjoh at gmail.com wrote:

> Maybe there's a use for a "test for characters" function or program,
> with arguments of a main string and a string/list of disallowed
> characters.

It seems to me fairly obvious there should be lexical equivalents for
STR$REPLACE, STR$TRANSLATE, the various STR$FIND_xxx routines and
possibly other STR$ routines.

This while waiting for regular expression support, either via lexicals 
or (preferably) integrated into the syntax of the language something 
like this:

$ foo = "abc123"
$ if foo .matches. "^a(\w+)(\d+)$"
$ then
$     say "Matches! Captured ''R1' and ''R2'."
$ else
$     say "Sorry, doesn't match."
$ endif

which would print

Matches! Captured bc and 123.

or perhaps the operator should be ".like." instead of ".matches.".

Not sure offhand what the most natural syntax for replacements would be.



More information about the Info-vax mailing list