XML technologies / Regular expressions / .NET
(Excerpt from "Regular expressions" by Jeffrey E. F. Friedl)
Microsoft’s .NET Framework, usable from Visual Basic, C#, C++ and other languages, includes a shared regex library standardizing regex usage across these languages. It provides a complete, powerful regex engine that is flexible, easy to use and fast. This book covers .NET 2.0, supplied with Visual Studio 2005.
Object and method syntax varies by language, but the objects and methods themselves are identical. Even complex examples transfer easily between .NET languages. This chapter’s examples use Visual Basic.
In this chapter
This chapter builds on Introduction to regular expressions through The art of writing regular expressions and assumes their foundations. Some readers may start here because they want only .NET, but should first consult the preface, especially typographic conventions, and earlier chapters. Chapters Introduction to regular expressions, Extended introductory examples and Features and dialects cover basic concepts, features and techniques; How regex engines work, Practical regex techniques and The art of writing regular expressions cover key areas directly relevant to .NET’s engine: how an NFA searches, greedy behavior, Backtracking and efficiency considerations.
Tables such as Overview of .NET regex constructs or Constructs covered in this section in Features and dialects make good references, but this book’s aim is to teach thinking in regexes.
We first examine .NET’s regex dialect, supported metacharacters and special considerations. We then explore its object model and regex-related classes. Finally, we build a small library by packaging prepared regexes in an assembly.
German edition copyright © 2008 by O’Reilly Verlag GmbH & Co. KG
You may print the online version for private use.
Otherwise, this chapter from "Reguläre Ausdrücke" is subject to the same terms as the bound edition: the work and all its parts are protected by copyright. All rights reserved, including reproduction, translation, microfilming, storage and processing in electronic systems.
O’Reilly Verlag GmbH & Co. KG, Balthasarstr. 81, 50670 Köln