Of white space, line ending, and GREP in BBEdit

This is completely "inside baseball" and likely of little interest, unless you happen to use BBEdit and LaTeX and want to search and replace using GREP. As a side benefit, it gives me a break from actually working on my tenure file!

The basic problem is finding white spaces and then replace them with LaTeX column separators (&), without having BBEdit include the line endings. An example text is:

2015    Spring  4770    1   3.9 4.5 4.4
2015    Spring  2110    3   4.4 4.5 4.4
2015    Fall    4760    1   4.3 4.3 4.3
2015    Fall    2110    2   4.4 4.3 4.3
2016    Winter  3100    3   4.4 4.5 4.4
2016    Winter  3100    2   4.0 4.5 4.4
2016    Spring  2110    2   4.5 4.4 4.4
2016    Spring  2110    3   4.8 4.4 4.4

I could, of course, just use the column copy and paste in BBEdit, but where is the fun in that!

My first inclination was to use

\s*

but that captures the line endings as well, so I turned to my trusted app Patterns and after a bit I settled on

([[:blank:]]*)

which looked like it did what I wanted in Patterns' search and replace window. The problem was that transferring this to BBEdit gave me

& 2 & 0 & 1 & 5     &  & S & p & r & i & n & g   &  & 4 & 7 & 7 & 0     &  & 1    &  & 3 & . & 9  &  & 4 & . & 5  &  & 4 & . & 4 & 
 & 2 & 0 & 1 & 5     &  & S & p & r & i & n & g   &  & 2 & 1 & 1 & 0      &  & 3    &  & 4 & . & 4  &  & 4 & . & 5  &  & 4 & . & 4 & 
 & 2 & 0 & 1 & 5     &  & F & a & l & l     &  & 4 & 7 & 6 & 0     &  & 1    &  & 4 & . & 3  &  & 4 & . & 3  &  & 4 & . & 3 & 
 & 2 & 0 & 1 & 5     &  & F & a & l & l     &  & 2 & 1 & 1 & 0     &  & 2    &  & 4 & . & 4  &  & 4 & . & 3  &  & 4 & . & 3 & 
 & 2 & 0 & 1 & 6     &  & W & i & n & t & e & r   &  & 3 & 1 & 0 & 0     &  & 3    &  & 4 & . & 4  &  & 4 & . & 5  &  & 4 & . & 4 & 
 & 2 & 0 & 1 & 6     &  & W & i & n & t & e & r   &  & 3 & 1 & 0 & 0     &  & 2    &  & 4 & . & 0  &  & 4 & . & 5  &  & 4 & . & 4 & 
 & 2 & 0 & 1 & 6     &  & S & p & r & i & n & g   &  & 2 & 1 & 1 & 0     &  & 2    &  & 4 & . & 5  &  & 4 & . & 4  &  & 4 & . & 4 & 
 & 2 & 0 & 1 & 6     &  & S & p & r & i & n & g   &  & 2 & 1 & 1 & 0     &  & 3    &  & 4 & . & 8  &  & 4 & . & 4  &  & 4 & . & 4 &

which is not exactly what I had in mind! After quite a bit of digging around, thinking that the problem was with posix in BBEdit, I finally figured out that the quantifiers are treated differently in BBEdit than in Patterns. The correct version in BBEdit is

([[:blank:]]+)

Patterns for some reason does not treat "*" as actual zero whereas BBEdit does. Using this and

\1 \&

gave me this beautifully formatted text instead

2015     & Spring   & 4770     & 1    & 3.9  & 4.5  & 4.4
2015     & Spring   & 2110     & 3    & 4.4  & 4.5  & 4.4
2015     & Fall     & 4760     & 1    & 4.3  & 4.3  & 4.3
2015     & Fall     & 2110     & 2    & 4.4  & 4.3  & 4.3
2016     & Winter   & 3100     & 3    & 4.4  & 4.5  & 4.4
2016     & Winter   & 3100     & 2    & 4.0  & 4.5  & 4.4
2016     & Spring   & 2110     & 2    & 4.5  & 4.4  & 4.4
2016     & Spring   & 2110     & 3    & 4.8  & 4.4  & 4.4

Now I just need the end of line symbols (and to make the next 14 tables) and I am done!

By the way, instead of the posix version you could use

([^\S\r\n]+)

The same thing apply with the quantifier.