Zoo tutorials: [ SQL | Linux | XML ]
ProgZoo: [ Java | C# | VB | C++ | Perl ]
Log in

A Gentle Introduction to
Java Programming

Regular Expression

 

Top Ten Programs

Regular Expression

A regular expression is a pattern which may match a string.

In this example the pattern (land|stan) matches land or stan. So Afghanistan and Finland match but Albania does not match.

1. [ Java ] Regular Expressions


Big

The match in Java must include the whole string. For that reason you must include .* at the beginning and .* at the end if your pattern is allowed to occur in the middle of the string.