Using Regex to add guestlist entries with Conditional Logic in Fluent Forms

Last year, I was building a website for my wedding. I build websites all the time. How hard could it be?

Well, I came across an issue with the RSVP form—plus ones and guests. Some of these DIY wedding website builders handle it really well. Most likely, they check your name against the invite list database, and if you’re listed with a plus one, the form provides an additional field. Seems like simple logic, BUT you also have to take into account a few tricky scenarios:

  • They might not capitalize the first letter of their name when they type it in.
  • You (or they) might have spelled the name wrong.
  • They might write “Chris” instead of “Christopher.”
  • Duplicate names (Jrs, IIIs, etc.)

So many things to think about!

Unfortunately, there isn’t a built-in way to handle this in Fluent Forms, but I was able to write some regex (with the help of ChatGPT) to make it work.

How It Works

First, create your RSVP form with a field for guests to enter their names. I used Zola’s sample wedding website as a reference (check it out here). It’s helpful to include some guiding text to make sure people enter their names correctly, like:

“Sarah Fortune (not The Fortune Family or Dr. & Mr. Fortune)”

Since we had more guests with plus ones than guests without, we decided to make a list of guests who were not bringing guests. In this example, our regex checks if “Sarah Fortune” gets a plus one. If she’s not in our list, conditional logic will reveal an additional field for her guest’s name.

Adding the conditional logic with regex

To add this in, create the guest name field in Fluent Forms. Select the field and under advanced settings in the sidebar, toggle conditional logic. Then, from the dropdown, select regex (see screenshot) and then “regex match”.


Now, adjust the regex expression below to include all the single people for your guest list (remember this is essentially checking the inverse).

^(?!.*b(?:phil|phillip|john|jon|bill|william|sue|susan)b).*$

That should do it! Don’t forget to test!


Things to Consider

This approach can get long if you have a big guest list—duplicate Sarahs, Jrs, or common names can make things tricky. We had about 120 guests, and as far as I know, there were no issues!

That said, please use at your own risk. Don’t come to me for money if all your guests accidentally got a plus one and now you have to foot the bill. 😬

Regex can be finicky, but it was a fun challenge to figure out. Let me know if you try something similar!