GHC 2018-01-22

9 comments.

, https://git.io/vNVYi in jarun/googler
@RishabhTayal Use sed:

```sh
curl -A "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.98 Safari/537.36" -sSL "https://www.google.com/search?q=hello" | \
  /usr/bin/sed -nE 's/.*About ([0-9,]+) results.*/\1/p'
```

or perl:

```sh
curl -A "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.98 Safari/537.36" -sSL "https://www.google.com/search?q=hello" | \
  perl -nle 'print "$1" if /(?<=About )([0-9,]+)(?= results)/'
```

or even a double grep:

```sh
curl -A "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.98 Safari/537.36" -sSL "https://www.google.com/search?q=hello" | \
   grep -Eo 'About [0-9,]+ results' | grep -Eo '[0-9,]+'
```

Of course there's also gawk, but I'm not sure /usr/bin/awk on macOS supports capture groups.

Seriously though, this is not a googler issue, and the issue tracker is not a discussion forum. This kind of questions should be directly to StackOverflow. If you want to learn text editing with grep, sed, awk, etc., there are plenty of good starting points, a few random ones off the top of my head:

http://www.grymoire.com/Unix/sed.html
http://www.grymoire.com/Unix/Awk.html
http://matt.might.net/articles/sculpting-text/
https://ferd.ca/awk-in-20-minutes.html

And I don't need to introduce Perl resources (maybe start with The Llama Book).

, https://git.io/vNVUB in jarun/googler
-P (for PCRE) was never supported by BSD grep. Read the man page of GNU grep.

, https://git.io/vNaP1 in Homebrew/homebrew-core
emacs 26.0.91 (devel)
=====================

Created with `brew bump-formula-pr`.

, https://git.io/vNaUw in Homebrew/homebrew-core
wget 1.19.4
===========

Created with `brew bump-formula-pr`.

, https://git.io/vN2Mw in Homebrew/homebrew-core
No problem.

, https://git.io/vN2Mr in Homebrew/homebrew-core
[bpo 32616](https://bugs.python.org/issue32616). The discussion should probably be continued there since I've demonstrated that this is not a Homebrew, or even macOS-specific problem. I'm too tired to do anything else today.

, https://git.io/vN2Mo in Homebrew/homebrew-core
CLT is 9.2, so I guess my benchmarks shouldn't be affected.

, https://git.io/vN2MK in Homebrew/homebrew-core
Hmm, just realized my Xcode is outdated (9.0.1 instead of 9.2). WTF.

, https://git.io/vN2M6 in Homebrew/homebrew-core
This is a py27+clang issue, not only on macOS. I'm composing my bpo bug report right now.

More comprehensive and refined benchmarks (using https://gist.github.com/zmwangx/f8151ba8907ba8159a07fdd1528fc2b5 ):

macOS 10.13.2:

```
2.082144	/usr/bin/python2.7
7.964049	/usr/local/bin/python2.7
8.750652	dist/python27-apple-clang-900/bin/python2.7
8.476405	dist/python27-clang-3.9/bin/python2.7
8.625660	dist/python27-clang-4.0/bin/python2.7
1.760096	dist/python27-clang-5.0/bin/python2.7
3.254814	/usr/local/bin/python3.6
2.864716	dist/python-master-apple-clang-900/bin/python3
3.071757	dist/python-master-clang-3.9/bin/python3
2.925192	dist/python-master-clang-4.0/bin/python3
2.908782	dist/python-master-clang-5.0/bin/python3
```

Ubuntu Artful in VirtualBox:

```
1.475095	/usr/bin/python2.7
8.576817	dist/python27-clang-3.9/bin/python2.7
8.165588	dist/python27-clang-4.0/bin/python2.7
1.779193	dist/python27-clang-5.0/bin/python2.7
1.728321	dist/python27-gcc-5/bin/python2.7
1.570040	dist/python27-gcc-6/bin/python2.7
1.604617	dist/python27-gcc-7/bin/python2.7
2.323037	/usr/bin/python3.6
2.964338	dist/python-master-clang-3.9/bin/python3
3.054277	dist/python-master-clang-4.0/bin/python3
2.734908	dist/python-master-clang-5.0/bin/python3
2.490278	dist/python-master-gcc-5/bin/python3
2.494691	dist/python-master-gcc-6/bin/python3
2.642277	dist/python-master-gcc-7/bin/python3
```