December 2002
Intermediate to advanced
1616 pages
39h 57m
English
The following rules govern the application of regular expressions.
As stated previously, a regular expression always matches the longest possible string, starting as far toward the beginning of the line as possible. For example, given the following string,
This (rug) is not what it once was (a long time ago), is it?
the expression /Th.*is/ matches
This (rug) is not what it once was (a long time ago), is
and /(.*)/ matches
(rug) is not what it once was (a long time ago)
However, /([^)]*)/ matches
(rug)
Given the following string,
singing songs, singing more and more
the expression /s.*ing/ matches
singing songs, singing
and /s.*ing song/ matches
singing song
Within some utilities, ...
Read now
Unlock full access