Beginning Regular Expressions 2005 phần 1 pps

78 257 0
Beginning Regular Expressions 2005 phần 1 pps

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

[...]... Example What Is a Word? x 10 3 10 3 10 4 10 4 10 5 10 5 10 8 11 1 11 2 11 3 11 4 11 5 11 6 11 7 11 9 12 0 12 8 12 9 13 2 13 3 13 3 13 5 13 6 13 7 13 9 13 9 14 1 14 3 14 4 14 4 14 6 14 9 15 0 15 3 15 5 15 8 16 1 16 4 Current Head Contents Identifying Word Boundaries The \< Syntax The \>Syntax The \b Syntax The \B Metacharacter Less-Common Word-Boundary Metacharacters Exercises Chapter 7: Parentheses in Regular Expressions Grouping Using... Inserting an Apostrophe Lookbehind 16 4 16 4 16 6 16 8 16 8 16 9 16 9 17 1 17 1 17 3 17 5 17 5 17 7 18 0 18 2 18 5 18 5 18 6 18 7 18 8 19 0 19 3 19 5 19 6 19 6 19 7 19 9 19 9 200 202 203 203 205 209 Positive Lookbehind Negative Lookbehind 209 213 How to Match Positions 214 Adding Commas to Large Numbers Exercises 216 220 xi Contents Current Head Chapter 9: Sensitivity and Specificity of Regular Expressions 2 21 What Are Sensitivity and... Method The Split() Method Using the Static Methods of the Regex Class The The The The The 511 512 512 517 517 518 518 518 519 519 519 519 520 5 21 522 526 528 5 31 IsMatch() Method as a Static Match() Method as a Static Matches() Method as a Static Replace() Method as a Static Split() Method as a Static 5 31 5 31 5 31 532 532 The Match and Matches Classes 532 The Match Class The GroupCollection and Group... Schema 16 16 17 17 17 21 21 22 23 27 28 28 28 29 29 29 29 30 30 30 30 30 31 31 An Analytical Approach to Using Regular Expressions 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 Regular Expressions Document All but Simple Regular Expressions. .. Matching Numeric Digits Exercises Chapter 13 : Regular Expressions Using findstr Introducing findstr Finding Literal Text Metacharacters Supported by findstr Quantifiers Character Classes Word-Boundary Positions Beginning- and End-of-Line Positions Command-Line Switch Examples The /v Switch The /a Switch 297 3 01 302 304 305 305 306 308 310 311 313 315 316 316 318 xiii Contents Current Head Single File... Introduction to Regular Expressions There are many occurrences of the sequence of characters car, as shown in a simple regular expressions search in OpenOffice.Org Writer in Figure 1- 1 To try it out for yourself, follow these steps: 1 Open Car.txt in OpenOffice.org Writer (regular expressions are supported in version 1. 1 and above) 2 3 4 Use Ctrl+F to open the Find and Replace dialog box Check the Regular Expressions. .. Lookahead and Lookbehind Exercises xvi 455 456 458 462 464 465 467 4 71 473 474 475 478 479 479 482 483 485 486 486 490 490 492 495 497 499 502 502 505 505 507 508 510 510 Current Head Contents Chapter 22: C# and Regular Expressions The Classes of the System.Text.RegularExpressions namespace An Introductory Example The Classes of System.Text.RegularExpressions The Regex Class The Options Property of the Regex... Much Should the Regular Expressions Do? 2 31 232 232 232 Knowing the Data, Sensitivity, and Specificity Abbreviations Characters from Other Languages Names Sensitivity and How to Achieve It Specificity and How to Maximize It Revisiting the Star Training Company Example Exercises Chapter 10 : Documenting and Debugging Regular Expressions 233 234 234 235 236 236 236 240 2 41 Documenting Regular Expressions. .. make effective use of the power that is available to the developer who understands the strengths and pitfalls of regular expressions Who This Book Is For Beginning Regular Expressions is designed for developers who need to manipulate text but are new to regular expressions or have tried regular expressions in the past but have found that the learning curve, presented by experts who didn’t realize the needs... chapter, you will learn the following: ❑ What regular expressions are ❑ What regular expressions can be used for ❑ Why regular expressions can seem daunting Chapter 1 The list of possible uses for 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 regular expressions and how they can help in working . Beginning Regular Expressions Andrew Watt 01_ 574892 ffirs.qxd 1/ 7/05 10 :48 PM Page iii 01_ 574892 ffirs.qxd 1/ 7/05 10 :48 PM Page ii Beginning Regular Expressions 01_ 574892 ffirs.qxd 1/ 7/05 10 :48. Square Brackets 11 3 Using Ranges in Character Classes 11 4 Alphabetic Ranges 11 5 Use [A-z] With Care 11 6 Digit Ranges in Character Classes 11 7 Hexadecimal Numbers 11 9 IP Addresses 12 0 Reverse Ranges. 1/ 7/05 10 :48 PM Page i 01_ 574892 ffirs.qxd 1/ 7/05 10 :48 PM Page ii Beginning Regular Expressions Andrew Watt 01_ 574892 ffirs.qxd 1/ 7/05 10 :48 PM Page iii Beginning Regular Expressions Published

Ngày đăng: 13/08/2014, 12:21

Tài liệu cùng người dùng

  • Đang cập nhật ...

Tài liệu liên quan