3 ms·
> I’d bet not even grep uses it. I’ll take you up on that bet. I see #include <regex.h> in every source repo of grep I can find right now. http://git.savannah
by dahart 8y ago
> I’d bet not even grep uses it.
I’ll take you up on that bet. I see #include <regex.h> in every source repo of grep I can find right now.
http://git.savannah.gnu.org/cgit/grep.git/tree/src/search.h http://git.savannah.gnu.org/cgit/grep.git/tree/src/search.h
https://opensource.apple.com/source/text_cmds/text_cmds-99/grep/grep.h.auto.html https://opensource.apple.com/source/text_cmds/text_cmds-99/g...
https://android.googlesource.com/platform/system/core.git/+/android-4.2.2_r1/toolbox/grep/grep.h https://android.googlesource.com/platform/system/core.git/+/...
https://github.com/c9/node-gnu-tools/blob/master/grep-src/src/search.h https://github.com/c9/node-gnu-tools/blob/master/grep-src/sr...
You owe me a beer. :)
BTW, I do super agree with your comment to just not use strtok, and also the idea that most people are better off parsing text in perl or python...
- jstimpfle 8y agoNot sure why that header is included there, though. I can't find any uses of the regex library. There are multiple custom matchers implemented. So maybe it's that the GNU regex library uses the grep sources. In any case, there don't seem to be any uses of regexec() or regcomp(), for example. Which would have surprised me anyway since that API is rather limiting (you cannot search incrementally). Let's get that beer sometime, anyway.