Using Google docs, regular expressions can be used to conduct search and replace operations. I had a list of email addresses that were preceded by the address in quotes. I wanted to remove the quotes and everything between them: “Name5@something.com”
This expression found everything up to the @ sign: [“][a-zA-z0-9.]+ (I assume A-z should be A-Z)
This expression found everything: [“][a-zA-z0-9.]+[@][a-zA-z0-9.]+[“]
The replacement was null. Regex cannot be used for replacement expressions in google docs. However, BBedit does allow regex for replacement.
In this example I wanted to capitalize the first letter of each sentence in a text file. I use \n to find the new line before the next sentence. I use and then used parens to save what was found, and [a-z] to find all lower case letters that come after a new line:
The lower case letter after the new line found with the above expression was saved in the expression \1. To make that lower case letter upper case I used \U before \1
From the Google help file for regular expressions:
Does not match
A period represents any character in the given position.
do, dog, dg, ads
An asterisk after a character represents a search for that preceding character repeated 0 or more times.
dog, dg, dooog
A plus after a character represents a search for that character displayed 1 or more times.
dg, dOg, doug
The previous expression is optional.
A caret must be placed at the beginning of a regular expression. It signifies the string starts with the character(s) or sequence placed after the caret. Note: This regular expression only works with Google Sheets.
A dog, his hog
A dollar sign must be placed at the end of a regular expression and signifies that the string ends with the character(s) or sequence placed before the dollar sign.Note: This regular expression only works with Google Sheets.
dog, hog, hot dog
dogs, hogs, doggy
The previous expression is repeated between A and B times, where A and B are numbers.
dg, dooog, dOg
[x], [xa], [xa5]
A character set indicates that just one of the given character(s) should occur in the current position. Usually, any characters are valid within brackets, including characters mentioned previously in expressions: [xa,$5Gg.]
dg, dOg, dooog
A character set range signifies a search for a character within the given range of characters. Common ranges include a-z, A-Z, and 0-9. Ranges can be combined into a single range: [a-zA-Z0-9]. Ranges can also be combined with character sets (mentioned previously): [a-zA-Z,&*].
dog, dug, dpg, drg
dg, dOg, dag
A character set beginning with a ^ signifies a search for a character that is not within the given set.
The New York Times is making Covid-19 data publicly available on GitHub. Fairfax Co provides daily updates but not historical data that I could find. I downloaded historical Covid data for all US counties provided by NYT, entered it into Numbers, selected out the Fairfax data and graphed the daily numbers. I plan to tweet the daily numbers since the county is no longer sending out txt alerts.
When attempting to remove some files from iMovie I came across a media clip that I wanted to delete. When I attempted to delete the file, I was told I didn’t have access and I should change permissions on the file. Unfortunately I couldn’t find the file using the filename since it was embedded in the iMovie package. The way to delete the file is to navigate to the folder Movies, then Get Info on the iMovie library file and select Show Package Contents. Navigate to the project folder and select Original Media. Get Info on the file that can’t be deleted and uncheck the Locked checkbox. Then return to iMovie and now the project and file can be deleted.
“Key to Trump’s popularity has been a rhetorical strategy identified in 1951 by political philosopher Eric Hoffer in a book called The True Believer. Hoffer noted that demagogues needed a disaffected population whose members felt they had lost the power they previously held, that they had been displaced either religiously, economically, culturally, or politically. Such people were willing to follow a leader who promised to return them to their former positions of prominence and thus to make the nation great again. But to cement their loyalty, the leader had to give them someone to hate. Who that was didn’t really matter: the group simply had to be blamed for all the troubles the leader’s supporters were suffering.”
I’m trying to clean out some of the 18,000 email message that I’ve saved. Many of those messages are should be deleted but it’s difficult to wade through them. The best way I’ve found is to search for those messages I know need to be deleted, mostly from mailing lists. The gmail syntax is: in:inbox from:search term
When filling in the email address while creating a new email message, saved addresses that were used in the past will often be filled in automatically as you type, even if the address was mistyped originally. To remove the bad address, in Mail go to Window>Previous Recipients. Find the bad address and remove it.