Understanding Regular Expressions in VB.NET

While creating your application in ASP.NET you should use the regular expressions to check the format of the input by a user for a particular control. If the user has typed in the wrong format then the request will not be processed.

Regular expressions in VB.NET are extensively used to validate and process a string. By validation we mean that the form of a user’s input meets certain criteria as defined by the developer. For example regular expressions can be used to verify the format of telephone number, social security numbers, email addresses, or any string that have a specific format. If the user’s input does not meet the format then the regular expression validator control is raised and the user will be prompted of the error.

By processing of the string we mean that you can parse a large amount of text to extract, edit, replace, or delete text substrings; or to add the extracted strings to a collection in order to produce a report. The significant feature of the regular expressions in VB.NET is that you can incorporate regular expressions of other languages such as Perl and Awk.

Since the classes of the regular expressions in VB.NET are derived from a common base class library, these regular expressions can be used with many languages and tools that are .NET compatible. You can use regular expressions in VB.NET for the applications to match behavior, backreferences, backtracking, quantifiers and empty matches, and thread safety purposes. There are regular expressions engines available that are used to match the pattern with the string. Some of the engines are Nondeterministic Finite Automation engine, Deterministic Finite Automation engine, and POSIX NFA engine.

The .NET Framework uses Nondeterministic Finite Automation (NFA) engine because they are more expressive than other engines such as Deterministic Finite Automation (DFA) engine and POSIX NFA engine. Moreover this engine can be used to quickly find matches or to favor specific expansions over others. Because of these engines the developer’s time is saved.

“Amazon and the Amazon logo are trademarks of Amazon.com, Inc. or its affiliates.”

| Privacy Policy for www.dotnet-guide.com | Disclosure | Contact |

Copyright - © 2004 - 2024 - All Rights Reserved.