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

From Expertiza_Wiki
Jump to navigation Jump to search
Line 7: Line 7:


[http://www.perl.com/doc/manual/html/pod/perlre.html Perl regular expression syntax]
[http://www.perl.com/doc/manual/html/pod/perlre.html Perl regular expression syntax]
Examples of regular expressions: <br/>
1. cat matches cat
2.


=== How regular expressions are handled in Java ===
=== How regular expressions are handled in Java ===
Line 16: Line 12:
An instance of the Pattern class represents a regular expression that is specified in string form in a syntax similiar to that used by Perl.
An instance of the Pattern class represents a regular expression that is specified in string form in a syntax similiar to that used by Perl.


Package summary for java.util.regex <br/>
[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


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

Revision as of 01:19, 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

An instance of the Pattern class represents a regular expression that is specified in string form in a syntax similiar to that used by Perl.

Package summary for java.util.regex

How regular expressions are handled in Ruby

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

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