Here's a rather breathless article claiming that vbscript is going away, but the article is light on details.
https://www.theregister.com/2023/10/10/microsoft_says_vbscript_will_be/
I use objRE = ObjectOpen("VBScript.RegExp") frequently, do I need to worry that this will soon stop working?
MSFT always deprecates stuff but doesn't always follow through, so it is hard to know with any certainty. That said, .Net regular expressions classes are available via the WinBatch .Net hosting subsystem. The learning curve isn't too steep and there are examples on this forum.
Here is a link to an old article using .Net regular expressions. It needs to be updated to the current WinBatch .Net function usage but it gives you a good idea of what is involved:
https://techsupt.winbatch.com/webcgi/webbatch.exe?techsupt/nftechsupt.web+WinBatch/dotNet/System_Text/RegularExpressions+RegEx.txt (https://techsupt.winbatch.com/webcgi/webbatch.exe?techsupt/nftechsupt.web+WinBatch/dotNet/System_Text/RegularExpressions+RegEx.txt)
got it, and got it working. Took a while to get the options syntax correct:
ObjectClrOption("useany","System")
oROpt = ObjectClrType("System.Text.RegularExpressions.RegexOptions", 1)
oReg = ObjectClrNew("System.Text.RegularExpressions.Regex",Pattern, oROpt)
oReg.CacheSize = ObjectType("ui2",30) ;2-byte unsigned integer.
You may find .net regex more robust than vbscript.
MSFT's official doublespeak on VBScript:
https://learn.microsoft.com/en-us/windows/whats-new/deprecated-features-resources (https://learn.microsoft.com/en-us/windows/whats-new/deprecated-features-resources)
It does not say anything about system COM Automation objects and their implementing DLLs, however.
Quote from: td on October 12, 2023, 06:56:20 AM
MSFT's official doublespeak on VBScript:
https://learn.microsoft.com/en-us/windows/whats-new/deprecated-features-resources (https://learn.microsoft.com/en-us/windows/whats-new/deprecated-features-resources)
It does not say anything about system COM Automation objects and their implementing DLLs, however.
There should be a Regex Pattern for 'doublespeak' ;D . I doubt MicroSocks will take away performing regex with vbscript, but equally believe they will want developers...etc... to rely more on .NET/PS
'Call me: 123-456-7890 ASAP' -match '(?<areaCode>\d\d\d)-\d\d\d-\d\d\d\d'
$Matches.areaCode