Start reading Java Regular Expressions on your Kindle in under a minute. Don't have a Kindle? Get your Kindle here.

Deliver to your Kindle or other device

 
 
 

Try it free

Sample the beginning of this book for free

Deliver to your Kindle or other device

Read books on your computer or other mobile devices with our FREE Kindle Reading Apps.
Java Regular Expressions: Taming the java.util.regex Engine (Expert's Voice)
 
 

Java Regular Expressions: Taming the java.util.regex Engine (Expert's Voice) [Kindle Edition]

Mehran Habibi
4.5 out of 5 stars  See all reviews (4 customer reviews)

Digital List Price: £25.95 What's this?
Print List Price: £28.50
Kindle Price: £20.30 includes VAT* & free wireless delivery via Amazon Whispernet
You Save: £8.20 (29%)
Unlike print books, digital books are subject to VAT.

Formats

Amazon Price New from Used from
Kindle Edition £20.30  
Paperback £27.07  

Product Description

Product Description

Java has always been an excellent language for working with objects. But Java's text manipulation mechanisms have always been limited, compared to languages like AWK and Perl. On the flip side, a regular expressions package in Java 2 Standard Edition (J2SE) brings hope to the Java text mechanisms. This package provides you everything necessary to use regular expressions—all packaged in a simplified object-oriented framework.

In addition to working examples and best practices, this book features a detailed API reference with examples supporting nearly every method, and a step-by-step tutorial to create your own regular expressions. With time, you'll discover that regular expressions are extremely powerful in your programming arsenal—and you'll enjoy using them! And once you've mastered these tools, you'll wonder how you ever managed without them!

About the Author

Mehran Habibi is an Application Architect for BankOne in Columbus, Ohio, where he resides with his lovely wife, Angela. Mehran has over eight years of IT experience, including positions with UUNET, Executive Jet, IBM, and OCLC. He has also worked as a university lecturer, national and international speaker, independent consultant, and Java certification instructor. Technologies of interest include Web Services, wireless tech, Java, and yes, C#. Mehran's professional focus is on architecture, XP team integration, technology leadership, and mentoring. He was a member of the honors program at The Ohio State University, graduated with a bachelor's degree in software engineering, and holds certifications in VC++, SCJP, and the SCJD.

Product details

  • Format: Kindle Edition
  • File Size: 1954 KB
  • Print Length: 273 pages
  • Page Numbers Source ISBN: 1590591070
  • Publisher: Apress; 1 edition (16 Feb 2004)
  • Sold by: Amazon Media EU S.à r.l.
  • Language English
  • ASIN: B001GQ2ZQ4
  • Text-to-Speech: Enabled
  • Average Customer Review: 4.5 out of 5 stars  See all reviews (4 customer reviews)
  • Amazon Bestsellers Rank: #196,451 Paid in Kindle Store (See Top 100 Paid in Kindle Store)
  •  Would you like to give feedback on images?


Tag this product

 (What's this?)
Think of a tag as a keyword or label you consider is strongly related to this product.
Tags will help all customers organise and find favourite items.
Your tags: Add your first tag
 

Customer Reviews

4 star
0
2 star
0
1 star
0
Most Helpful Customer Reviews
3 of 3 people found the following review helpful
Format:Paperback
The book consists of 250 pages of wide-spaced text, split into 5 chapters. The first chapter is an introduction to regular expressions, explaining basic regular expression syntax. The book's pace is relatively slow, which may suit some people but not others. It doesn't explain many of the "gotcha's" or differences between regex flavors. Clearly, this book is aimed at people who are relatively new to regular expressions, and only plan to use them with Java.

The second chapter is the most useful part of the book. It describes all the classes in the java.util.regex package, and nearly all of their methods. Most of the descriptions come with example Java source code illustrating its use. If you prefer to learn by reading Java source code rather than English, you'll appreciate these code snippets.

The third chapter explains advanced regular expression syntax, such as lazy and possessive quantifiers (called "qualifiers" in the book), and lookaround. Unfortunately, the quality of the book starts to go downhill from here. Minor errors such as using alternation (I|i)ce instead of a far more efficient character class [Ii]ce (page 104) or stating that \d represents a digit in the replacement text (page 107; \d only works in the regex, not in the replacement) could be attributed to sloppy editing. But the example that was intended to explain positive lookahead (page 130) is simply wrong. The regex (?=^255).* does exactly what ^255.* does. The crucial aspect of lookahead (it doesn't consume the text it matches) is completely irrelevant in this example.

The fourth chapter could have easily been omitted from the book. It talks more about object-oriented programming techniques than about regular expressions. Some of the advice is questionable. The author suggests storing regular expressions in external files, so they can be edited without recompiling the application. The problem with this advice is that the regular expressions will then sit in an external file without context, making them much harder to understand. It contradicts the books key selling point: most concepts are explained with regexes used in Java code. If another programmer has to maintain the code later, a better idea is to use a tool such as RegexBuddy to insert a detailed English description as a Java comment into the Java source code (RegexBuddy generates them on the Use tab).

The fifth chapter presents you with several more elaborate examples performing a number of real-world tasks with regular expressions in Java. While the examples are relatively simple, they do bring everything together nicely.

Should you buy this book? While it's definitely not perfect, I would recommend this book to Java developers who are experienced with Java, but have little or no experience with regular expressions. The book's description of the java.util.regex package is far more detailed than documentation included with the JDK. But to learn the ins and outs of the regular expression syntax itself, you'll need to complement this book with another resource

Comment | 
Was this review helpful to you?
1 of 1 people found the following review helpful
Format:Paperback
This book is an excellent introduction to regular expressions in general and the Java regex package in particular. The author assumes that the reader has no experience with regular expressions so even if the subject is completely new to you, you will be able to follow along easily.

The book approaches the topic in a clever way that makes it both an excellent tutorial as well as an excellent reference to keep nearby. The first chapter covers regular expression syntax. The second chapter looks at the two main classes, Pattern and Matcher, and discusses each of the methods in these classes. The way the information is presented makes it a perfect tutorial, as the methods are introduced in a sensible order that allows the detailed discussion to build. At the same time, since each method is discussed with excellent description and examples, it serves as a useful reference. Chapter three looks at some advanced topics such as groups, qualifiers, and lookaheads. In chapter four the author gives us some advice and chapter five demonstrates some useful examples. The books ends with a reference, summarizing the topics discussed in the first two chapters.

Other than a few minor misprints and one slightly confusing group example early on I could find nothing to complain about. Any Java programmer interested in learning regular expressions will find this book extremely useful. It is hard to imagine that there could be a better book on regular expressions than this one.

Comment | 
Was this review helpful to you?
1 of 1 people found the following review helpful
Format:Paperback
I've had this book a bit over a day. Yes, I've read the entire book. It is that good.

As I first approached it, I was afraid of this book. It's so easy to explain regular expressions in terribly dry and technical ways. Max, the author, doesn't do that.

Don't fear your painful memories of the wordy, boring, and expensive text books read during university studies. This book won't bring them back. Max has again demonstrated his excellent, clear and concise writing skills with Java Regular Expressions.

This book is not some boring reference or cookbook of regular expressions, excellent ones of which can be found for free on the internet. Instead, this book provides excellent explanations detailing techniques on how to understand and create regular expressions – object-oriented techniques at that! This is not your father’s procedural regex reference.

New to java.util.regex? Buy this book, not that other one.

Comment | 
Was this review helpful to you?

Customer Discussions

This product's forum
Discussion Replies Latest Post
No discussions yet

Ask questions, Share opinions, Gain insight
Start a new discussion
Topic:
First post:
Prompts for sign-in
 

Search Customer Discussions
Search all Amazon discussions
   


Look for similar items by category


Look for similar items by subject


Amazon Media EU S.à r.l. GB Privacy Statement Amazon Media EU S.à r.l. GB Delivery Information Amazon Media EU S.à r.l. GB Returns & Exchanges