CSC/ECE 517 Summer 2008/wiki1 1 mb: Difference between revisions

From Expertiza_Wiki
Jump to navigation Jump to search
Line 13: Line 13:
[http://java.sun.com/j2se/1.4.2/docs/api/java/util/regex/package-summary.html Package summary for java.util.regex]
[http://java.sun.com/j2se/1.4.2/docs/api/java/util/regex/package-summary.html Package summary for java.util.regex]


The java.util.regex package contains two classes: <br/>
The [http://java.sun.com/j2se/1.4.2/docs/api/java/util/regex/Pattern.html Pattern class] and
the [http://java.sun.com/j2se/1.4.2/docs/api/java/util/regex/Matcher.html Matcher class].


=== How regular expressions are handled in Ruby ===
=== How regular expressions are handled in Ruby ===

Revision as of 01:23, 7 June 2008

Regular expression support in Java and Ruby

What are regular expressions?

Regular expressions provide an efficient way to match patterns against strings. Both Java and Ruby use a regular expression syntax similar to Perl.

Perl regular expression syntax

How regular expressions are handled in Java

In Java, regular expressions are supported using the java.util.regex package.
Package summary for java.util.regex

The java.util.regex package contains two classes:
The Pattern class and the Matcher class.

How regular expressions are handled in Ruby

Class summary for Regexp
http://www.ruby-doc.org/core/classes/Regexp.html

Example Uses

Other useful links

Basic regular expression syntax
Advanced regular expression syntax

java.util.regex Examples from The Java Developers Almanac 1.4
http://exampledepot.com/egs/java.util.regex/pkg.html