Help with Code (Extracting House Number / Initials)

What are you trying to achieve?

Hi everyone,

I’m trying to build a scenario where the Trello card name is generated automatically from two fields:

From Street line 1:
• If the line contains a house number (e.g. “123 High St.”) → return only the number (“123”).
• If there is no number, take the first letter of each word, capitalised (e.g. “Home Sweet Home” → “HSH”).

From Customer’s Name:
• Return only the initials, capitalised (e.g. “John Causbe Cowgirl” → “JCC”).

Ideally, the final Trello card name would combine these two values (e.g. “123, JCC”).

Is it possible to achieve this using Make.com’s built-in functions?
Any examples, formulas or code snippets would be hugely appreciated!

Thank you :folded_hands:

Steps taken so far

I’ve already tried the built-in AI tools (AI, GPT, Gemini), but the code they generate doesn’t work.

Welcome to the Make community!

To do this, you can use the built-in function:

  • replace
    replace(text; search string; replacement string)

This function may have also been covered in the Make Academy tutorials — refer to the Make Academy Course Overview to learn more.

Here’s an example of how you can use this function with a regular expression pattern:

{{ replace(1.text; "/\s*(?:(?<=\d)+\s[\w\W]+?$|(?:(?<=[A-Za-z])\w+\s?)+)\s*/i"; emptystring) }}
(copy-paste the above into the field, or type it exactly as shown)

Hope this helps! Let me know if there are any further questions or issues.

@samliew
P.S.: investing some effort into the tutorials in the Make Academy will save you lots of time and frustration using Make!