Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

How to? Use typed envars using regex.

Apr
318
7
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.
 
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
 
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.
 

Similar threads

Back
Top