How to? Use typed envars using regex.

Apr 13, 2010
236
3
58
The Hague
#1
I want to create an envar that may only contain 1 or more chars from the following set: [a-zA-Z\s\.]
That's it. I can't get this to work.
I find the helpfile confusing.
/T option not listed at the beginning of the helptext, only at the end.

How many colons? With or without quotes? Same syntax as in DIR, e.g?

Could you provide an example please?

Regards, DJ.
 

samintz

Scott Mintz
May 20, 2008
1,295
11
Solon, OH, USA
#2
I was successful in getting the type parsing to work with types 1-6.
Code:
[Z:\] set /t:1 foo=1

[Z:\] set /t:1 foo=hello
TCC: (Sys) Data supplied is of wrong type.
 "foo=hello"
However, regular expressions just don't seem to work no matter what I try.
Code:
set /t:regex:"[A-Za-z0-9_]+" foo=Hello World
TCC: (Sys) Data supplied is of wrong type.
 "foo=Hello World"

set /t:7:"[A-Za-z0-9_\s\.]+" foo=Hello World
TCC: (Sys) Data supplied is of wrong type.
 "foo=Hello World"
Once a type is set it remains in effect until the variable is unset. For example if I do, set/ t:1 foo=1. Any subsequent set foo=xxx operation will enforce the int type.

-Scott
 
Apr 13, 2010
236
3
58
The Hague
#3
Thank you very much for your reply Scott.
It's always an relief to find one is not alone in struggles like this.
Thank you for corroborating my experiences.

DJ.