Basic HTML version of Foils prepared April 16,1996

Foil 46 Minimal Matching in Regular Expressions

From Perl5 and Advanced Perl4 Features Computational Science for Information Age Course CPS616 Material -- April 16,1996. by Geoffrey C. Fox


The default pattern matching in Perl is greedy or maximal size matching
There is now the ? option to designate the selection of match of minimum size
* is replaced by *? to specify minimal match 0 or more times
+? represents minimal match 1 time
?? represents minimal match 0 or 1 times
{n}? minimal match exactly n times
{n,}? minimal match at least n times
{n,m}? minimal match At least n but not more than m times



© Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu

If you have any comments about this server, send e-mail to webmaster@npac.syr.edu.

Page produced by wwwfoil on Sat Sep 6 1997