13.2.10 Non-capturing clusters
It is often required to specify a cluster
(typically for quantification) but without triggering
the capture of submatch information. Such
clusters are called non-capturing. In such cases,
use (?: instead of ( as the cluster opener. In
the following example, the non-capturing cluster
eliminates the “directory” portion of a given
pathname, and the capturing cluster identifies the
basename.
| | (pregexp-match "^(?:[a-z]*/)*([a-z]+)$"
"/usr/local/bin/mzscheme")
⇒ ("/usr/local/bin/mzscheme" "mzscheme")
|