
Why doesn’t findstr use the standard regular expression library? - nikbackm
https://blogs.msdn.microsoft.com/oldnewthing/20151209-00/?p=92361
======
X-Istence
> For example, Safari uses PCRE, but the PCRE copyright, licensing terms, and
> disclaimer do not appear in the Safari EULA or any other Safari
> documentation I can find.

Open Safari -> Help -> Acknowledgements -> Cmd + F -> PCRE

Bam, PCRE license found!

[http://imgur.com/lFkvkFS](http://imgur.com/lFkvkFS)

------
aaronem
So basically for the same reason make still cares about the difference between
0x20 and 0x09.

Which honestly never made sense to me. I mean, we all know the story about how
the original author realized having leading tabs, rather than leading
whitespace, as a syntax element was a terrible idea. But I never understood
why he couldn't modify make to accept the latter instead of the former -- more
specifically, why "there's already an existing user base" was cited as a
reason not to make this _non-breaking_ change.

------
howeyc
Wow, two reason for this, one of which I didn't expect (the first).

1\. Because the code is so old we don't want to have an intern figure out how
to do it. (Adding a switch for a new PCRE, such as /P, is hard) Oh, and
reading and understanding licenses is HARD?!?!? WTF?

2\. It would break backwards-compatability if we did it. (Well, duh).

I understand now it may not be worth it (powershell/.net is the future or
whatever), but really, at no time in the 90's and 00's did you think it may be
worth some time?

~~~
phphphph
> did you think it may be worth some time?

So how much would you pay for it, roughly? I'm sure if we find enough people
to chip in, it will happen.

~~~
howeyc
Don't be so obtuse, getting a feature in a proprietary operating system when
the vendor has a shitload of customers doesn't work that way.

For example, the windows command prompt has been shit forever, only after more
than a decade does resize and copy/paste work properly.

Changes happen when they want and on their schedule. You can feel free to
throw money in the millions at them, then you might at least have someone talk
to you about their direction/plan.

------
junto
I wonder why the duplicate detector didn't go off on this. This URL is exactly
the same as the one noted in the flagged comment (show hidden).

@Dang: Have HN changed the way in which dupes are detected? Also, should we be
flagging comments that point to previous submissions btw? It seems a bit harsh
to flag a comment in this way, although I agree that the previous post doesn't
add anything to this particular discussion. Wouldn't a downvote be more
appropriate?

~~~
JoshuaRedmond
Yes, the way duplicates are handled has changed, here[0] is dang's post on it
from a few months back. And the mods are actively trying to give good posts
another change, as shown by nikbackm's comment. I like the change, but perhaps
people flagging should be more aware that not everyone has seen the memo
about.

[0] -
[https://news.ycombinator.com/item?id=10223645](https://news.ycombinator.com/item?id=10223645)

~~~
dmit
Here's a more recent comment that describes the evolution of this feature:
[https://news.ycombinator.com/item?id=10705926](https://news.ycombinator.com/item?id=10705926)

------
sillypog
I honestly thought this would be talking about a startup pronounced
"Findster".

------
nokya
"Besides, you can’t change the regular expression language accepted by a
program after it has been released, because that would break all the scripts
that used the old language."

Lie. In my world, this is commonly referred to as an "option".

Many command-line programs have options that disable or enable some standard
to perform their operations.

And guess what program does that? Grep.

Grep option switches allow the user to choose between basic, regular and Perl
expression engines (-E -F -G -B options).

Breaking the existing scripts would have been caused by setting another
regular expression by default in findstr, which is basically something that
nobody would ask.

The real reason findstr is not improved is because Bob left the company and
probably took the source code with him.

~~~
gjm11
> Lie. In my world, this is commonly referred to as an "option".

It seems a bit unfair to call Chen a liar on this point since _the very same
paragraph you quoted from_ ends like this: "A change in the regular expression
syntax would require a new switch to opt into the new behavior."

(I do think it's pretty weird that he portrays this as a major problem. I
suppose the point is that if you care about backwards compatibility your
options aren't "crappy old RE syntax" and "nice new RE syntax", they're
"crappy old RE syntax" and "crappy old RE syntax as default, and nice new RE
syntax with an option" and that's not so appealing because (1) now maybe your
program needs two regexp engines in it and (2) even a trivial inconvenience
like remembering to add the option is something of a nuisance.)

