Regular Expression lookahead with "else" in VBScript.
Posted on 2008-10-23
I have a question with respect to a regular expression in VBScript. I'm trying to do a look ahead and if TRUE perform some item and if false perform another item and then just do a substitution at the end regardless of true or false at that point.
I'm trying to do something like:
Basically, if the string being evaluated has a "/" and a "@" then I want it to perform ([\s\""\d:]?) otherwise
([\s\""\d:]). The difference between the latter 2 statements is that I allow for 0 to a 1 of space at the end (the "?") or the alternative is that I do not allow any space. (nothing there).
I'm doing a lookahead for the "/" and "@" but how to I get it to do the TRUE ELSE/OR FALSE. Notice I do have the "|" in there to separate the 2 statements.
I am doing this in VBScript.
Any ideas or assistance would be greatly appreciated.