Regular Expression

From Progzoo

Revision as of 11:12, 21 July 2008 by 196.15.16.20 (Talk)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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 .

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.

[Font] [Default] [Show] [Resize] [History] [Profile]