2015 archive
Regular Expressions Make My Brain Hurt 0
If they also make your brain hurt, here’s a good tutorial.
If you are not sure what Regular Expressions (often called “regex”) are, they are a versatile tool for searching text for specific strings. You can search for strings with various permutations and qualifications.
Here’s an example, illustrating a search of the file /usr/doc/HTML/en/common/gpl-license for the any occurrence of a string including two characters followed by the characters “cept” (the -i means “ignore case”). The working directory was /usr/doc/HTML/en/common/, which is where the GNU Public License resides in Slackware –Current.
The text is choppy because the output of the command displays individual lines from the text file, rather than sentences:
$ grep -i "..cept" gpl-license
License. (Exception: if the Program itself is interactive but
special exception, the source code distributed need not include except as expressly provided under this License. Any attempt
5. You are not required to accept this License, since you have not
prohibited by law if you do not accept this License. Therefore, by
Program), you indicate your acceptance of this License to do so, and
make exceptions for this. Our decision will be guided by the two goals
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
Here’s some more searches I did during the tutorial:
grep "^[A-Z].*\.$" gpl-license <--Searches for all lines starting with capital letters or ending with periods.
egrep "(public license)" gpl-license <--Searches for all lines including the string "public license."
grep "^[A-Z]" gpl-license <--searches for all lines starting with capital letters.
These are very simple regex searches.
Here’s a complex regular expression string that I grabbed from a website. Note that it is just the search string, not prefaced by a search command:
\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}\b
When I understand that, I will consider that I have achieved geekdom.
Yes, this is my idea of fun.
“The Smart One” 0
Turn off the oven. He’s done.
Afterthought:
Even a facade of sanity is now anathema in Republican World.
“An Armed Society Is a Polite Society” 0
Be polite during family activities.
The gun discharged, hitting the son in the face.
. . . and another gun that fires itself.
In a Nutshell 0
Dick Polman sums up the Republicans’ Benghazi farce:
Follow the link for the play-by-play.
Decoding de Code 0
One more time: A complaint about “political correctness” means “I want license to be nasty without penalty.”
Still Rising Again after All These Years 0
It’s the big lie of the secesh, the big lie they tell themselves even more than they tell it to others: the big lie that the Civil War was not about slavery.
“Just the Facts, Ma’am” 0
Wait. No, we meant our facts, not real facts.
As my two or three regular readers know, I’m not a big fan of Hilary Clinton, but I freely admit that that has more to do with style than with substance; her substance is pretty damn substantial and her making peace with President Obama after the 2008 nomination race showed a lot of class (on both their parts, I must add).
In the case of the Benghazi Republican scamdal, I must agree with John Cole.
“The Smart One” 0
Daniel Ruth, in the midst of a larger discussion the relationship between Marco “Rube” Rubio and Jeb! makes this telling offhand observation (emphasis added):
“An Armed Society Is a Polite Society” 0
I guess this is what is meant by “guarded politeness.”
In the Pink 0
The NFL is run by some of the worst people in the world.










