Skip to main content
Participant
January 23, 2024
Answered

Regular Expression function for EasyCatalog/InDesign

  • January 23, 2024
  • 2 replies
  • 607 views

Hi all

Hope you can help with the below. 

 

I am working with EasyCatalog plugin for InDesign and am trying to extract certain data from a cell with a function in a Custom Field Options. 

This is the usual data in the cell: 

 

<p>Yarn: 100% New Zealand Thin Wool or Tencel</p> <p>– Primary backing: 100% Polyester</p> <p>– Backing: 100% Polyester</p> <p>– Pile Height: 16mm</p>

 

I need to extract "Pile Height: (and the numbers) ". I spend the last 2 days reading about REGEX expressions etc. and I can't manage to do that no matter how I try. Could someone have any ideas?

 

Many thanks!

Miro.

Correct answer Eugene Tyson

Pile Height: 16mm

 

Regex

(?i)Pile\hHeight\:\h\d+?mm

 

Not sure if it's helpful for the catalog - but looks right to me

2 replies

Participating Frequently
May 7, 2025

Hi Miro,

It sounds like you're trying to extract the "Pile Height" value using a regex expression in EasyCatalog, and it’s definitely doable with the right pattern. Given the structure of your data, here's a regex that should work:

 

Pile Height:\s*(\d+mm)

Explanation:

  • Pile Height: is the literal text you're looking to match.

  • \s* accounts for any spaces or line breaks after the colon.

  • (\d+mm) captures the number (digits) followed by "mm", which is the value you're interested in.

You should be able to use this regex in the Custom Field Options to pull out the "Pile Height" and its corresponding number.

Let me know if that works, or if you run into any issues!

Best,
Henry James

Eugene TysonCommunity ExpertCorrect answer
Community Expert
January 23, 2024

Pile Height: 16mm

 

Regex

(?i)Pile\hHeight\:\h\d+?mm

 

Not sure if it's helpful for the catalog - but looks right to me

Participant
January 23, 2024

I seems to work! Thanks a lot!