Class of the Month: JDK 1.4 Supports Regular Expressions Montana

Regular expressions are a useful programming tool. The fact that Java now natively supports them simplifies many programming tasks that used to require cumbersome code.

Local Companies

Computer Port
406-883-6237
314 First Street East Suite 202
Polson, MT
Design Services
(406) 586-2674
2100 Fairway Dr
Bozeman, MT
Montana Gbs
(406) 541-2323
126 E Broadway St
Missoula, MT
Concise Logic
(406) 572-3323
10 Jawbone Rd
Martinsdale, MT
Exdivio Solutions Inc
(406) 433-7800
Sidney, MT
Click Here Designs, LLC
406-883-6237
314 First Street East Suite 202
Polson, MT
Isc Distributors
(406) 586-3105
101 E Mendenhall St
Bozeman, MT
Synesis 7
(406) 496-6400
220 N Alaska St
Butte, MT
Johnson and Associates Inc
(406) 458-9173
Helena, MT
Recco North America
(406) 883-1861
711 Main St
Polson, MT

provided by: 
Originally published at Internet.com


Regular expressions have been around for a long time. They come in very handy for text processing tasks. Some attribute the success of Perl to its superb ability of handling regular expressions. While there have been third-party classes that support regular expressions, with JDK 1.4, Java provides native support via the java.util.regex package.

Piroz Mohseni

Usage of regular expressions boils down to two components:

1. Defining the regular expression. This is a pattern that describes what is to be matched. 2. Applying the regular expression on a sequence of characters. Determining whether a match was found or not, successive finds, and replacements are some of the common operations involving regular expressions.

The Pattern class focuses on the first component. You use this class to define a regular expression. By representing the regular expression as an object, you can reuse the expression in your code. This is particularly useful in cases where you need to apply the same expression to multiple strings (e.g., line-by-line processing of a text file). The following line creates a pattern based on the regular expression "[0-9]" which matches any digits from 0 to 9. This pattern can also be represented as "/d"...

Read article at Internet.com site

Featured Local Company

Click Here Designs, LLC

406-883-6237
314 First Street East Suite 202
Polson, MT
http://www.clickheredesigns.com/

Click Here Designs, LLC has been creating professional websites from Polson since 1997. Our extensive portfolio is available on our website. We offer complete web development services, including search engine optimization, web site maintenance, and complete webmaster services. When in doubtClick Here.

Related Articles
- Some Insight Into Inner Classes in Java, Part 1 Montana
Inner classes can simplify some design by enriching the classes in which they are defined. They might add a "facet" to the behavior of an enclosing class, thus enriching its interactions with other classes. They can also be used as access control points where the inner class can be used to provide controlled access to some resource or to define isolated callbacks or to other beneficial purposes.
- Class of the Month: GregorianCalendar Montana
- Class of the Month: Control Event Executions with the New Timer Class Montana
- Use the BodyTagSupport Class to Add More Flexibility to JSP Pages Montana
- User Code: A Little Socket App Montana
- Class of the Month: JSP Tag Libraries and the TagSupport Class Montana
- Class of the Month: The Reflection API Montana
- User Code: W3Eval Montana
- Manage Your Application Settings via the Preferences API Montana
- Class of the Month: Making HTTP Connections Montana
Related Articles
- Some Insight Into Inner Classes in Java, Part 1 Montana
Inner classes can simplify some design by enriching the classes in which they are defined. They might add a "facet" to the behavior of an enclosing class, thus enriching its interactions with other classes. They can also be used as access control points where the inner class can be used to provide controlled access to some resource or to define isolated callbacks or to other beneficial purposes.
- Class of the Month: GregorianCalendar Montana
- Class of the Month: Control Event Executions with the New Timer Class Montana
- Use the BodyTagSupport Class to Add More Flexibility to JSP Pages Montana
- User Code: A Little Socket App Montana
- Class of the Month: JSP Tag Libraries and the TagSupport Class Montana
- Class of the Month: The Reflection API Montana
- User Code: W3Eval Montana
- Manage Your Application Settings via the Preferences API Montana
- Class of the Month: Making HTTP Connections Montana

Topics: 
Architecture & Design Languages & Tools Project Management Web Services
Database Microsoft & .NET Security Wireless
Java Open Source Techniques XML