Regex Tools |
grep |
PowerGREP |
RegexBuddy |
RegexMagic |
General Applications |
EditPad Lite |
EditPad Pro |
Google Docs |
Google Sheets |
LibreOffice |
Notepad++ |
Databases |
Google BigQuery |
MySQL |
Oracle |
PostgreSQL |
Modern Visual Basic is based on the Microsoft .NET framework and can thus readily access its excellent support for regular expressions. It’s a dramatic improvement from what was available to Visual Basic 6 developers. See the topic about .NET to learn more about the classes in the Systems.Text.RegularExpressions namespace. When you put it all together, you could check whether a regex can match a string in VB.NET with a code snippet like this:
Imports System.Text.RegularExpressions; Dim FoundMatch As Boolean = False Try Dim RegexObj As New Regex("\A\w+\z") FoundMatch = RegexObj.IsMatch(SubjectString) Catch ex As ArgumentException 'Syntax error in the regular expression End Try
Visual Basic string literals do not treat the backslash as a metacharacter. You can easily format a regular expression as a VB string by putting double quotes around it and doubling up any double quotes inside the regex. Starting with Visual Basic 14 (Visual Studio 2015), even line breaks are literals inside VB strings. This makes it very convenient to use RegexOptions.IgnorePatternWhitespace to format your regular expression with extra whitespace and line breaks for readability.
| Quick Start | Tutorial | Search & Replace | Tools & Languages | Examples | Reference |
| grep | PowerGREP | RegexBuddy | RegexMagic |
| EditPad Lite | EditPad Pro | Google Docs | Google Sheets | LibreOffice | Notepad++ |
| Boost | C# | Delphi | F# | GNU (Linux) | Groovy | ICU (Unicode) | Java | JavaScript | .NET | PCRE (C/C++) | PCRE2 (C/C++) | Perl | PHP | POSIX | PowerShell | Python | Python.NET and IronPython | R | RE2 | Ruby | std::regex | Tcl | TypeScript | VBScript | Visual Basic 6 | Visual Basic (.NET) | wxWidgets | XML Schema | XQuery & XPath | Xojo | XRegExp |
| Google BigQuery | MySQL | Oracle | PostgreSQL |
Page URL: https://www.regular-expressions.info/vbnet.html
Page last updated: 11 October 2025
Site last updated: 14 October 2025
Copyright © 2003-2025 Jan Goyvaerts. All rights reserved.