vbscript is going away

Started by kdmoyers, October 11, 2023, 04:51:47 AM

Previous topic - Next topic

kdmoyers

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
Code (winbatch) Select
objRE = ObjectOpen("VBScript.RegExp") frequently, do I need to worry that this will soon stop working?
The mind is everything; What you think, you become.

td

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

"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

kdmoyers

got it, and got it working.  Took a while to get the options syntax correct:
Code (winbatch) Select
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.

The mind is everything; What you think, you become.

stanl

You may find .net regex more robust than vbscript.

td

MSFT's official doublespeak on VBScript:

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.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

stanl

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

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