I’m almost certain I already know the answer to this one, but my VBScript is very rusty so I’m hoping to be proved wrong.
I am using a bespoke system that uses VBScript to evaluate validation on form fields. The problem is that the VBScript can only exist on one line and must return a boolean.
This is fine for checking string lengths and the existence of a specific string within a string, but I need to perform some regular expression checks.
So my question is, is there any way to condense the following to one line?
Set myRegExp = New RegExp
myRegExp.IgnoreCase = True
myRegExp.Global = True
myRegExp.Pattern = "^[\w\s]*$"
myRegExp.Test("Test St*ring")
The example would probably survive without the IgnoreCase and Global properties.
Thanks in advance,
Rich
Depending on how this ‘bespoke system’ works:
POC for #3 – all you need is love – no I mean the ability to put a .wsc like:
on the computer and the line
in that one line. Test script:
output: