I’m looking for a SimpleGrepSedPerlOrPythonOneLiner that outputs all quotations in a text.
Example 1:
echo “HAL,” noted Frank, “said that everything was going extremely well.” | SimpleGrepSedPerlOrPythonOneLiner
stdout:
'HAL,' 'said that everything was going extremely well.”
Example 2:
cat MicrosoftWindowsXPEula.txt | SimpleGrepSedPerlOrPythonOneLiner
stdout:
'EULA' 'Software' 'Workstation Computer' 'Device' 'DRM'
etc.
I like this:
It’s a little verbose, but it handles escaped quotes and backtracking a lot better than the simplest implementation. What it’s saying is:
If you don’t need that much power–say it’s only likely to be dialog and not structured quotes, then
probably works about as well as anything else.