Regular Expression Recipes - Nathan A. Good

Regular Expression Recipes

A Problem-Solution Approach

(Autor)

Buch | Softcover
289 Seiten
2004 | 1st ed.
Apress (Verlag)
978-1-59059-441-4 (ISBN)
32,09 inkl. MwSt
Regular expressions are an essential part of programming, but they sure are hard to come to grips with, aren't they? Regular Expression Recipes provides you with all the open-source regular expressions you'll ever need, and explains how to use each one. Languages covered include Perl, PHP, grep, vim, Python, and shell.
Regular expressions are an essential part of programming, but they sure are hard to come to grips with, aren't they? Fortunately, we have the answer for you! 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 countless pages of explanatory syntax.


Author Nathan A. Good includes syntax references only when necessary. 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. And this book acts as a useful reference to keep handy for those moments when an answer is needed fast.

Nathan A. Good lives in the Twin Cities area of Minnesota. He is a contractor with Alliance of Computer Professionals in Bloomington. When he isn't writing software, Nathan enjoys building PCs and servers, reading about and working with new technologies, and trying to get all his friends to make the move to open source software. When he's not at a computer (which he admits is not often), he spends time with his family, at his church, and at the movies.

1. Introduction and purpose Regular expressions defined b. When to use regular expressions c. When not to use regular expressions 2. Syntax a. shell reference i. grep ii. find b. Perl reference c. PHP reference d. vim reference e. Python reference 101 Regular Expressions 3. Words and text i. Finding blank lines ii. Finding words iii. Finding multiple words with one search iv. Finding variations on words (John, Jon, Jonathan) v. Finding similar words (bat, cat, mat) vi. Replacing words vii. Replacing newline characters viii. Replacing tab characters ix. Finding high-ASCII characters x. Finding repeated words xi. Searching for repeated words across multiple lines xii. Searching for lines beginning with a word xiii. Searching for lines ending with a word xiv. Capitalizing the first letter of a sentence xv. Filtering spam xvi. Filtering profanity xvii. Finding strings in quotes xviii. Escaping quotes xix. Removing escape sequences xx. Adding semicolons to the end of a line xxi. Adding to the beginning of a line xxii. Replacing smart quotes with straight quotes xxiii. Finding repeating words with different case xxiv. Replacing TM with (TM) xxv. Splitting lines in a file xxvi. Joining lines in a file xxvii. Replacing 2nd with 2nd 4. URLs and Paths i. Finding log files with ranges ii. Extracting query strings from URLs iii. Extracting hostnames from URLs iv. Formatting URLs v. Formatting file paths vi. Extracting directories from full paths vii. Extracting filenames from full paths viii. Extracting file extensions from full paths ix. Replacing URLs with links x. Replacing email addresses with links xi. Searching for multiple file types xii. Changing the extensions of multiple files xiii. Making URL query string substitutions xiv. Writing safe query strings xv. RewritingURLs 5. CSV and Tab-delimited files i. Finding bad CSV records ii. Finding bad Tab-delimited records iii. Changing CSV to tab-delimited iv. Changing tab-delimited files to CSV v. Extracting CSV fields vi. Extracting tab-delimited fields vii. Extracting fields from a CSV file to a new file viii. Extracting fields from a Tab-delimited file to a new file 6. Formatting and validating i. Formatting Phone Numbers ii. Formatting US Dates iii. Formatting European Dates iv. Formatting US Currency v. Removing formatting from phone numbers vi. Removing formatting from Credit Card numbers vii. Limiting user input to alpha characters viii. Limiting user input to numeric characters ix. Limiting user input to length x. Validating IP Addresses xi. Validating Email Addresses xii. Validating URLs xiii. Validating US Phone Numbers xiv. Validating International Phone Numbers xv. Validating Numbers xvi. Validating Dates in MM/DD/YYYY xvii. Validating Dates in YYYY-MM-DD xviii. Validating US Postal Codes xix. Extracting usernames from email addresses xx. Extracting dailing codes from International phone numbers xxi. Reformatting peoples' names (first name, last name) 7. HTML and XML i. Removing white space from HTML ii. Removing white space from CSS iii. Making HTML

Zusatzinfo XXIX, 289 p.
Verlagsort Berkley
Sprache englisch
Maße 178 x 235 mm
Themenwelt Mathematik / Informatik Informatik Programmiersprachen / -werkzeuge
Mathematik / Informatik Informatik Software Entwicklung
Informatik Theorie / Studium Compilerbau
ISBN-10 1-59059-441-X / 159059441X
ISBN-13 978-1-59059-441-4 / 9781590594414
Zustand Neuware
Haben Sie eine Frage zum Produkt?
Mehr entdecken
aus dem Bereich
Grundlagen und Anwendungen

von Hanspeter Mössenböck

Buch | Softcover (2024)
dpunkt (Verlag)
29,90
a beginner's guide to learning llvm compiler tools and core …

von Kai Nacke

Buch | Softcover (2024)
Packt Publishing Limited (Verlag)
49,85