Copy text from anywhere and quickly use the specific sections you need in your snippets

Hey Text Blaze community :fire:

It's week 6 of the Text Blaze Feature of the Week series where I post weekly about cool features to showcase all the awesome stuff you can do with Text Blaze :sunglasses:

Copy text from anywhere and quickly use the specific sections you need in your snippets

Do you find yourself copying text to use in emails/messages often? It can be time-consuming to go through a large chunk of text and copy the few pieces that you need.

Using Text Blaze's clipboard command, you can copy an entire body of text and quickly use only the parts of it you need right within your snippets.

Not only that, but the clipboard command can be used in combination with other Text Blaze commands (forms, formulas, and regex) to truly help you save time.

GIF - Clipboard Sheets

Three things to know about the clipboard command:

  1. The clipboard command inserts the current contents of your clipboard.

  2. Using functions such as split and regular expressions (regex), you can quickly reference specific sections of the text that you copied.

  3. You can use the clipboard command and regex combined with the if command to insert content that depends on your clipboard contents.

Note: clipboard commands cannot be previewed in the community.

Example 1: Basic use of the clipboard command

You would use this snippet after you copied someone's name to quickly include their name in your message.

Hey {clipboard},

I hope you're doing well!

Example 2: Using the clipboard command with regex

This snippet would be used to include copied information (such as a person's name and phone number) in your messages.

For example, if you copied a large chunk of text that includes "Name: Dylan" and "Phone Number: 123-456-7890" then this snippet would automatically add this information.

Hi {=extractregex({clipboard}, "Name: (\w+)")},

I wanted to follow up on your issue. If I don't hear from you this week I will give you a call at {=extractregex({clipboard}, "Phone number: (.+)")}.

Example 3: Using the clipboard command with regex, the if command, and the error command

This snippet can help you quickly validate an email from your clipboard contents.

For example, if you copy someone's email, this snippet would help you make sure the email you copied is formatted correctly.

It uses the clipboard command + other Text Blaze features to help you make sure that the email you copied is formatted correctly.

Hi there,

{if: testregex({clipboard}, "^\w+.?\w+?@\w+.\w+?.?\w+?.?\w+?$")}I received an email from {clipboard}. Do you recognize this email?{else}{error: invalid email address; block=yes}{endif}

3 Likes

Hi @Dylan Would you be able to break down how to set up example 2? What I figured out was that you are telling the formula to look through the clipboard information and extract everything after the words "Name: " and "Phone number: ". However, what's the difference between (\w+) and (.+)? Thank you!

hey @Jennifer_Saavedra

Character types:
\w means "any word character" which usually means alphanumeric (letters, numbers, regardless of case) plus underscore (_). \d means a digit and . means any character except line break.

Quantifiers (show after the character type)
+ means one or more such characters. * means any number of characters including zero and ? means one or zero such characters.

Other
^ represents the start of the line and $ represents the end of it.

Here's a useful regex cheatsheet.

image

5 Likes

Took me a bit of work to replicate what you had in your preview animation but with the help of your post & AI I have it all up and running and I can't wait to use it. Thanks for the tip and sharing!! :trophy:

1 Like