Synopses & Reviews
- Match characters sets
- Match repeating characters (using minimums and maximums if needed)
- Match (or ignore) based on case
- Build sub-expressions
- Use all of the special characters
- Work with excape sequences
- Use POSIX classes to simplify complex expressions
- Use back-references
- Use look-behind operators
Sams Teach Yourself Regular Expressions in 10 Minutes is a tutorial book organized into a series of easy-to-follow 10-minute lessons. These well targeted lessons teach you in 10 minutes what other books might take hundreds of pages to cover. Instead of dwelling on syntax, terminology, and arcane examples and scenarios, this book takes a very hands-on approach to solving the needs of the majority of RegEx users who simply need to manipulate data.
Presenting a quick approach for learning Regular Expressions, this text provides useful, complete examples and usage notes for many relevant tasks and implementations. It includes test code in numerous languages so that the examples can be applied and used immediately.
About the Author
Ben Forta is Macromedia Inc.'s Senior Technical Evangelist and has more than two decades of experience in the computer industry in product development, support, training, and marketing. Ben is the author of the popular Sams Teach Yourself SQL in 10 Minutes (in this same series), ColdFusion Web Application Construction Kit, its sequel Advanced ColdFusion Application Development, as well as books on JavaServer Pages, Windows development, mobile computing, and other topics. More than one-quarter million Ben Forta books have been printed in more than a dozen languages worldwide. He writes regular columns on Internet and application development topics and spends a considerable amount of time lecturing and speaking on application development worldwide. Ben welcomes your email at firstname.lastname@example.org and invites you to visit his Web site at http://www.forta.com/.
Table of Contents
1. Introducing Regular Expressions.
Understanding the Need. How Regular Expressions Are Used. So What Exactly Is a Regular Expression? Using Regular Expressions. Before You Get Started. Summary.
2. Matching—Single Characters.
Matching Literal Text. Matching Any Characters. Matching Special Characters. Summary.
3. Matching Sets of Characters.
Matching One of Several Characters. Using Character Set Ranges. "Anything But" Matching. Summary.
4. Using Metacharacters.
Escaping Revisited. Matching Whitespace Characters. Matching Specific Character Types. Using POSIX Character Classes. Summary.
5. Repeating Matches.
How Many Matches? Using Intervals. Preventing Over Matching. Summary.
6. Position Matching.
Using Boundaries. Using Word Boundaries. Defining String Boundaries. Summary.
7. Using Subexpressions.
Understanding Subexpressions. Grouping with Subexpressions. Nesting Subexpressions. Summary.
8. Using Backreferences.
Understanding Backreferences. Matching with Backreferences. Performing Replace Operations. Summary.
9. Looking Ahead and Behind.
Introducing Lookaround. Looking Ahead. Looking Behind. Combining Lookahead and Lookbehind. Negating Lookaround. Summary.
10. Embedding Conditions.
Why Embed Conditions? Using Conditions. Summary.
Appendix A: Regular Expressions in Popular Applications and Languages.
Appendix B: Regular Expression Solutions to Common Problems.
Appendix C: The Regular Expression Tester.
Understanding the Regular Expression Tester Application. Obtaining a Copy of the Application.