Tag: Regex

April 24, 2009 / by Jeffery Hicks / VBScript / 3 Comments

VBScript Complex Regex Replace

A few days ago I posted a blog entry on simple regular expression replacements in VBScript. Let me show you a more complex example. It helps to have a purpose, even for demonstration so my need is to convert an html table to CSV output using regular expressions.
Read More

April 21, 2009 / by Jeffery Hicks / VBScript / 1 Comment

VBScript Simple Regex Replace

Last week I talked about using Regular Expressions in VBScript. In that post I focused on simple matching. However, you can also do string replacements using the regular expression object's Replace() method. You specify a string to replace and its replacement text. I always test the expression to make sure the string exists before doing anything. Here's a function I use for this task.
Read More

April 14, 2009 / by Jeffery Hicks / VBScript / 1 Comment

VBScript Regular Expressions

I seem to find my self turning to regular expressions more often these days, often to help out a fellow scripter in one of the many scripting forums I keep tabs on. I thought I'd take a moment and provide a brief explanation on how to use regular expressions in VBScript. First off, for those who don't know, a regular expression is a way of identifying or matching a string against a pattern. For example we all know that 172.16.100.200 looks like an IP address because of its pattern. The string roygbiv@rainbow.net looks like an email address, again based on the pattern. A regular expression can be used identify strings based on a pattern.
Read More

March 2, 2009 / by Jeffery Hicks / Windows PowerShell / 4 Comments

Parse HOSTS file with PowerShell

In a recent discussion in the PowerShell forum at ScriptingAnswers.com, a member was trying to parse the HOSTS file on a number of desktops. This is a thankless but probably useful task that seems perfectly suited to a scripted solution. What we came up with was a way to turn entries in the HOSTS file to objects in PowerShell. Once we have an object then we can do all sorts of fun things with it. Here is an enhanced version of the original solution.
Read More

RSS SAPIEN Info Center

Search the Archives

Join our mailing list

Enter your email address to subscribe to our mailing lists for Monthly Blog Digests, Product Announcements and more (you can choose which you receive once you sign-up!)

Tags

Categories

Archives

BlogRoll

PowerShell Links

Information

Dashboard