Struggling to create a Substitute formula

I’m working on a character generator for Dungeons and Dragons and I’m having trouble building a formula to get all the information in one place.

This is the view on the form I created:
Screen Shot 2021-08-10 at 1.22.19 PM

My goal is to create a formula that get rid of the numbers and just displays what Race the player selected (elf, dragonborn, etc.) for easier readability in grid view.

When I write the formula to only refer to a single number it works fine.
Screen Shot 2021-08-10 at 1.26.39 PM

But when I try and have the formula substitute multiple numbers with a blank space it returns an error message.

I was using the example formula on the side as a reference which uses => instead of a comma to separate the value being substituted with the new value but that didn’t make a difference. I’m pretty sure I copied the format of the example correctly otherwise so I’m not sure what I’m doing well.

I have no experience programming, I’m just teaching myself as I go along so any help/advice would be extremely appreciated. Thank you!

Hi there! Try this:

REGEX_REPLACE({Race (d12)}, "\\d+\\.\\s", "")

This formula uses regular expressions to replace combination of number, period and empty space with a given string (in our case empty string “”).

Hi Tom. Just wondering why you numbered them in the first place? The numbers don’t signify anything do they?

Hey augumented, I numbered them because it’s basically a table for people to roll on during character creation. So they’d roll a 12 sided die for race.

1 Like

Thanks Ela I tried it and it works!!!

1 Like

This topic was solved and automatically closed 15 days after the last reply. New replies are no longer allowed.