rent-now

Rent More, Save More! Use code: ECRENTAL

5% off 1 book, 7% off 2 books, 10% off 3+ books

9781590594414

Regular Expression Recipes : A Problem-Solution Approach

by
  • ISBN13:

    9781590594414

  • ISBN10:

    159059441X

  • Format: Paperback
  • Copyright: 2005-01-30
  • Publisher: Springer-Verlag New York Inc
  • Purchase Benefits
  • Free Shipping Icon Free Shipping On Orders Over $35!
    Your order must be $35 or more to qualify for free economy shipping. Bulk sales, PO's, Marketplace items, eBooks and apparel do not qualify for this offer.
  • eCampus.com Logo Get Rewarded for Ordering Your Textbooks! Enroll Now
List Price: $34.99 Save up to $0.03
  • Buy New
    $34.96

    USUALLY SHIPS IN 2-3 BUSINESS DAYS

Summary

Regular Expressions are an essential part of programming, but they are hard to come to grips with, aren't they? Fortunately, we have the answer for you! Open Source Regular Expression Recipes provides you with all the open source regular expressions you'll ever need, and explains how to use each one. This way, you can learn by example, rather than muddling through endless pages of syntax explanation. Languages covered include Perl, PHP, grep, vim, Python, and shell. Web and applications developers, and system administrators will find the examples both accurate and relevant.

Table of Contents

About the Author ix
About the Technical Reviewer xi
Acknowledgments xiii
Introduction xv
Syntax Overview xix
Words and Text
1(64)
Finding Blank Lines
2(2)
Finding Words
4(3)
Finding Multiple Words with One Search
7(3)
Finding Variations on Words (John, Jon, Jonathan)
10(3)
Finding Similar Words (Bat, Cat, Mat)
13(3)
Replacing Words
16(2)
Replacing Everything Between Two Delimiters
18(2)
Replacing Tab Characters
20(3)
Testing Complexity of Passwords
23(3)
Finding Repeated Words
26(2)
Searching for Repeated Words Across Multiple Lines
28(2)
Searching for Lines Beginning with a Word
30(2)
Searching for Lines Ending with a Word
32(3)
Capitalizing the First Letter of a Word
35(2)
Filtering Spam
37(3)
Filtering Profanity
40(3)
Finding Strings in Quotes
43(3)
Escaping Quotes
46(3)
Removing Escaped Sequences
49(2)
Adding Semicolons at the End of a Line
51(1)
Adding to the Beginning of a Line
52(2)
Replacing Smart Quotes with Straight Quotes
54(2)
Replacing Copyright Symbols
56(1)
Replacing™ with (TM)
57(2)
Splitting Lines in a File
59(2)
Joining Lines in a File
61(2)
Removing Everything on a Line After a Certain Character
63(2)
URLs and Paths
65(44)
Finding Log Files with Ranges
66(3)
Extracting Query Strings from URLs
69(3)
Extracting Hostnames from URLs
72(3)
Formatting URLs
75(4)
Translating Unix Paths to DOS Paths
79(2)
Extracting Directories from Full Paths
81(3)
Extracting Filenames from Full Paths
84(3)
Extracting File Extensions from Full Paths
87(3)
Replacing URLs with Links
90(3)
Replacing E-mail Addresses with Links
93(3)
Searching for Multiple File Types
96(2)
Changing the Extensions of Multiple Files
98(3)
Making URL Query String Substitutions
101(4)
Rewriting URLs
105(1)
Replacing IP Addresses in URLs
106(3)
CSV and Tab-Delimited Files
109(20)
Finding Bad CSV Records
110(3)
Finding Bad Tab-Delimited Records
113(3)
Changing CSV Files to Tab-Delimited Files
116(4)
Changing Tab-Delimited Files to CSV Files
120(4)
Extracting CSV Fields
124(2)
Extracting Tab-Delimited Fields
126(3)
Formatting and Validating
129(66)
Formatting U.S. Phone Numbers
130(2)
Formatting U.S. Dates
132(3)
Validating Alternate Dates
135(4)
Formatting Large Numbers
139(3)
Formatting Negative Numbers
142(2)
Formatting Single Digits
144(2)
Limiting User Input to Alpha Characters
146(2)
Validating U.S. Currency
148(3)
Limiting User Input to 15 Characters
151(2)
Validating IP Addresses
153(3)
Validating E-mail Addresses
156(3)
Validating URLs
159(3)
Validating U.S. Phone Numbers
162(3)
Validating U.S. Social Security Numbers
165(3)
Validating Credit Card Numbers
168(3)
Validating Dates in MM/DD/YYYY
171(3)
Validating Times
174(4)
Validating U.S. Postal Codes
178(2)
Extracting Usernames from E-mail Addresses
180(3)
Extracting Dialing Codes from International Phone Numbers
183(3)
Reformatting People's Names (First Name, Last Name)
186(3)
Finding Addresses with Post Office Boxes
189(3)
Validating Affirmative Responses
192(3)
HTML and XML
195(24)
Removing Whitespace from HTML
196(4)
Removing Whitespace from CSS
200(3)
Making HTML Tags Lowercase
203(2)
Removing an HTML Attribute
205(5)
Searching for HTML Attributes
210(3)
Escaping Characters for HTML
213(2)
Finding Unclosed XML Tags
215(4)
Coding and Using Commands
219(68)
Finding Code Comments
220(6)
Finding Lines with an Odd Number of Quotes
226(3)
Reordering Method Parameters
229(4)
Changing a Method Name
233(2)
Removing Inline Comments
235(2)
Commenting Out Code
237(2)
Uncommenting Out Code
239(2)
Searching for Variable Declarations
241(4)
Searching for Words Within Comments
245(3)
Filtering the Output of ps
248(3)
Filtering the Output of netstat
251(4)
Filtering the Output of du
255(3)
Setting a SQL Owner
258(3)
Finding a Method Declaration
261(3)
Changing Null Comparisons
264(3)
Changing DOS Text to Unix Text
267(2)
Searching for a Subject in Mail Files
269(3)
Formatting Bind Configuration Files
272(2)
Parsing the Output of df
274(3)
Parsing Apache Log Files
277(4)
Parsing Unix syslog Files
281(2)
Parsing INI Files
283(4)
Index 287

Supplemental Materials

What is included with this book?

The New copy of this book will include any supplemental materials advertised. Please check the title of the book to determine if it should include any access cards, study guides, lab manuals, CDs, etc.

The Used, Rental and eBook copies of this book are not guaranteed to include any supplemental materials. Typically, only the book itself is included. This is true even if the title states it includes any access cards, study guides, lab manuals, CDs, etc.

Rewards Program