develooper Front page | perl.perl5.porters | Postings from February 2011

Re: Registry for proposed new regex modifiers; was: Optimizingqr/STRING/msixpodual for amusement

Thread Previous | Thread Next
From:
Zsbán Ambrus
Date:
February 22, 2011 14:15
Subject:
Re: Registry for proposed new regex modifiers; was: Optimizingqr/STRING/msixpodual for amusement
Message ID:
AANLkTik=vQQv5gO8qAQKRKkgrKdS+E0q0xyuo7sO-mYt@mail.gmail.com
On Tue, Feb 22, 2011 at 3:19 PM, Ed Avis <eda@waniasset.com> wrote:
> Also useful would be something to disable the scanning behaviour of regexps and
> force them to match the entire string.  Three quarters of all regexp tests I
> write look like /\A...\z/ and it would be handy to have a shortcut for this.

Seconded.  The grep command already have such switches: -x to match
only entire lines, and -w to match only whole words. Perhaps we should
use the switch /z to match only the entire string, /Z to match an
entire string except possibly a final newline, /mZ to match an entire
line, and /b to match an entire word only.

Ambrus

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About