Regular expressions and TextExpander are a fantastic combination. I use regular expressions to save myself a ton of time on repetitive text manipulation. Replace all lines which start with "- " with "\t" Here’s the snippet I use to do that: // Start with the clipboard content …and turn them into HTML list items: Suggested snippets exclude most single dictionary wordsĪdds new notification preference for snippet suggestionsįixes secure input notifications for Chrome Fixes secure input notifications for Chrome Adds new notification preference for snippet suggestions I use a JavaScript regular expression to take text lists such as this: - Suggested snippets exclude most single dictionary words Enter your abbreviation, and voilà, you get your stripped URL. Set an abbreviation, then copy the link above to your clipboard. Strip the HTML query everything after the ? up toĢ. Var result = TextExpander.pasteboardText Make a new snippet in TextExpander, and set the Content: popup to JavaScript, then enter this as the snippet content: // Start with the clipboard content Here’s an example of what you’ve got:įor fun, let’s also handle the case when you’ve got the URL in HTML format, such as:ġ. You want to strip everything from the question mark (?) to the closing quotation mark, if present. This is the perfect job for a regular expression, because there’s a pattern. Let’s say that you frequently copy URLs to the clipboard and that these URLs have a bunch of tracking junk at the end in the form of a query string. The Info You Need At Your Fingertips Find the information you need and keep your communications consistent with powerful abbreviations that streamline and speed up everything you type. Blogger and podcaster Jason Snell writes that regular expressions saved him “hundreds of hours of drudgery”. Works with Mac, Windows, Chrome, iPhone, and iPad. Regular Expressions can be incredibly useful when searching and replacing patterns in text. 1 I found a custom text inserter extension for Google Chrome, called Auto Text Expander for Google Chrome 2 Template:quote-book 3 Reversion 4 bankers. This is specifically for TextExpander 5 and TextExpander touch 3.5 and later. Use regular expressions on your Mac, iPad, and iPhone with TextExpander JavaScript snippets. This free (and ad-free) extension adds basic javascript to your pages to check if your last set of consecutive keystrokes matches any of any number of custom.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |