Chapter 6. Pattern Matching with Regular Expressions


6. Pattern Matching with Regular Expressions

Regular expression support was introduced in Java JDK 1.4. Regular expressions specify patterns that can be matched within character sequences. Regular expressions are extremely useful in parsing strings, and will often save a programmer a lot of time and effort in performing a task in comparison to a solution that does not make use of regular expressions. Prior to being added to Java, regular expressions had been used for years by UNIX programmers. Standard UNIX tools such as Sed and Awk make use of regular expressions. Regular expressions are also commonly used in the Perl programming language. The addition of regular expressions to the JDK is a powerful addition to core Java capability.

In this chapter, you will learn how to use the regular expression features of Java to find, match, and replace text. With this knowledge you will be able to identify areas where you can add regular expression processing to your applications.




JavaT Phrasebook. Essential Code and Commands
Java Phrasebook
ISBN: 0672329077
EAN: 2147483647
Year: 2004
Pages: 166

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net