|
![](/i/fill.gif) |
Invisible <voi### [at] dev null> wrote:
> On 17/07/2012 07:28 AM, Warp wrote:
> > Invisible<voi### [at] dev null> wrote:
> >> In my limited experience, people don't use regexes for simple pattern
> >> matches.
> >
> > Yes, because you have decades of extensive experience on how eg. unix users
> > typically use regexes.
> Perhaps you mean like
You don't seem to grasp what "the most common usage" means. It does not
mean "the most prominent examples displayed on webpages" or "the most
prominent examples that I have seen". It means the forms that people
*most commonly* use, as in raw numbers. Count how many people use a
completely syntax-less regex or with just a simple wildcard, vs. the
times when someone has to write a really large and complex expression.
I'd estimate that the former wins about a million to one.
> Or how about
> dmesg | egrep '(s|h)d[a-z]'
If you want to build your straw man, at least use examples that conform
to your straw man. That's a bad example because it can be understood in
about 2 seconds.
> while(<STDIN>)
> {
> my($line) = $_;
> chomp($line);
> if($line !~ /<DIR>/)
> {
> if ($line =~ /.{28}(\d\d)-(\d\d)-(\d\d).{8}(.+)$/)
> {
> my($filename) = $4;
> my($yymmdd) = "$3$1$2";
> if($yymmdd lt "971222")
> {
> print "copy $filename \\oldie\n";
> }
> }
> }
> }
Also, if you are building your straw man, at least try to use actual
regexes and not some unrelated scripting language.
--
- Warp
Post a reply to this message
|
![](/i/fill.gif) |