Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống
1
/ 771 trang
THÔNG TIN TÀI LIỆU
Thông tin cơ bản
Định dạng
Số trang
771
Dung lượng
24,24 MB
Nội dung
[...]... strengths and pitfalls of regularexpressions Who This Book Is For BeginningRegularExpressions is designed for developers who need to manipulate text but are new toregularexpressions or have tried regularexpressions in the past but have found that the learning curve, presented by experts who didn’t realize the needs of newcomers to the topic, was just too steep to allow them to make progress This... how to make regularexpressions do what you want them to do and avoid creating regularexpressions that don’t meet your intentions Beginning chapters introduce regularexpressions and show you a method you can use to break down a text manipulation problem into component parts so that you can make an intelligent choice about constructing a regular expression pattern that matches what you want it to match... adapt to allow you to explore solutions to the problems that you meet Whether you are an occasional programmer or simply one who hasn’t used regularexpressions yet, you will be shown the component parts of regular expressions, what they mean, how to use them, and pitfalls to be aware of when using them Working examples form a core part of how you learn to create, understand, and use regular expressions. .. Approach to Using RegularExpressions 31 Express and Document What You Want to Do in English Consider the Data Source and Its Likely Contents Consider the Regular Expression Options Available Consider Sensitivity and Specificity Create Appropriate RegularExpressions Document All but Simple RegularExpressions 32 34 34 34 35 35 Document What You Expect the Regular Expression to Do Document What You Want to. .. their primary or only operating system You won’t need to spend time understanding aspects of Unix to begin to use regularexpressions All of the tools and languages presented in this book run on Windows, although versions of many are available that will run on other platforms too BeginningRegularExpressions takes you forward from things you are likely to know already, such as the use of the * and ? characters... text To solve more complex problems, I encourage you to set out a problem definition and progressively refine it to express it in English in a way that corresponds to a regular expression pattern that does what you want it to do The second part of the book devotes a chapter to each of several technologies available on the Windows platform You are shown how to use each tool or language with regular expressions. .. that it conforms to the rules of Extensible Markup Language (XML) syntax and complies with company policy to use XHTML code You might want to check that user input into a Windows application satisfies necessary criteria to allow correct processing In this chapter, you will learn the following: ❑ What regularexpressions are ❑ What regularexpressions can be used for ❑ Why regularexpressions can seem... 1-2 4 Introduction toRegularExpressions Don’t worry too much about the syntax for matching the positions at the beginning and end of words for the moment You’ll see the various forms of syntax for that in Chapter 6 What Can RegularExpressions Be Used For? The potential number of uses for regularexpressions is enormous This section briefly describes some examples of what regularexpressions can be... break regularexpressions down into their component parts and think carefully about what you want them to achieve for you, they can become a very useful tool, in fact an essential tool, in your developer skillset This book aims to help you overcome the hurdles that make so many developers uncomfortable with regularexpressions and allow you to make effective use of the power that is available to the developer... a tool that allows the manipulation of text is almost endless, with text being so widespread Sadly, many computer users and developers have little or no knowledge of regularexpressions and how they can help in working with text This book aims to change that What Are Regular Expressions? Regularexpressions are patterns of characters that match, or fail to match, sequences of characters in text To . Need to Use This Book xxiii Conventions xxiii Source Code xxiv Errata xxiv p2p.wrox.com xxv Chapter 1: Introduction to Regular Expressions 1 What Are Regular Expressions? 2 What Can Regular Expressions. Want to Do with a Regular Expression 17 The Languages That Support Regular Expressions 17 Replacing Text in Quantity 17 Chapter 2: Regular Expression Tools and an Approach to Using Them 21 Regular. Editor Jim Minatel Development Editor Marcia Ellett Technical Editors Douglas J. Steele Darren Neimke Production Editor Felicia Robinson Copy Editor Jeri Freedman/Foxxe Editorial Services Editorial