PocketKnife - Regex Replacer

A workflow action to reformat your content with ease

What is the Regex Replace function for? 

Standardize your data structure, transform data or refine values within text effortlessly. 

Utilize the Regex Replace workflow action on the PocketKnife HubSpot add on to accomplish these. Simply define the Regular Expressions once, and let the workflow handle the rest of the process.

For example: get the domain from an email address.

 

How to set up Regex Replace in PocketKnife? 

There is no setup needed within the PocketKnife HubSpot add on itself. The Regex Replacer workflow action is available in your HubSpot portal from the moment you connect it to PocketKnife

How to set up Regex Replacer in your HubSpot Portal?

Before you begin, please take note of some reminders and guidelines: 

Before you begin, please take note of some reminders and guidelines: 

  1. Make sure that you have access to your HubSpot portal 
  2. We strongly recommend that this feature only be used by those who have knowledge of Regular Expressions. Otherwise, you could negatively impact your database and content. 
  3. How does Regex work? You can explore a more detailed documentation on Regular Expressions by following the link on Regex 101. 
  4. Click this link to practice and do a Regex Test. 

 

Finally, to set up your Regex Replace within HubSpot, start by:  

Creating a workflow. It could be a contact, company or deal workflow.

Follow this link to HubSpot’s Knowledge Base on how to create a workflow 

 

The example below shows you how to use the Regex Replace workflow action to find and reformat a deal date. Follow the steps. 

Step 1: Create a (deal-based) workflow and set the trigger
Step 2: Choose the Regex Replacer workflow action from PocketKnife. 



Step 3: Define the reformatting action
This is where knowledge of Regex Regular Expression is critical. And if you're not acquaited with Regular Expressions, ChatGPT can help you out.

 

Select the appropriate options for the following fields.

  1. Text: Define (1) what you want to reformat or choose a text field property (2) to reformat
  2. Regex: define the Regular Expressions Again, this is where having a knowledge of Regex is very important. 
  3. Replacement: define the outcome

    (1) Define what you want to reformat


    (2) A property to reformat



    1. Step 4: Add a branch (OK, ERROR) based on the RegEx Replace action above
      1. Choose for the branch action based on one property or action output 

      2. Choose for Action output Status + click Next

      3. Set Branch 1 to value OK. Set Branch 2 to ERROR


      Step 5: Select action outputs based on successes and failures
    2. If the RegEx Replace is successful, choose to set the action output result (that is, the outcome) in a text field property. For the property, you can choose an existing property or create a new one.


    3. Success message




      Error message
    4. If the RegEx Replace failed, you can choose to get a notification about it with an error message or task to fix the issue. Based on this, you should choose the action output status. 




    Congratulations!  

    You’ve just set up the RegEx Replacer feature of leadstreet's PocketKnife HubSpot add on.

     

    Monitor the performance of the Regex Replace Workflow Action 

    On the PocketKnife dashboard you can monitor how many Regex Replacers are running.

    The number allowed depends on your PocketKnife HubSpot add on subscription plan (Freemium, your Single Feature, Pro or Enterprise).

    To upgrade your subscription plan, go to Subscription & Billing under the username of your account and choose the plan that fits your needs.

     

    Any Questions 

    Please contact our support team via this form