# Regex search & replace / extract for first name/last name

**URL:** <https://forum.bubble.io/t/regex-search-replace-extract-for-first-name-last-name/283777>\
**Category:** App Organization\
**Created:** [September 17, 2023, 9:17pm UTC](https://forum.bubble.io/t/regex-search-replace-extract-for-first-name-last-name/283777 "2023-09-17T21:17:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![yann.amadieu](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/yann.amadieu/32/187994_2.png) [@yann.amadieu](https://forum.bubble.io/u/yann.amadieu)\
**Post date:** [September 17, 2023, 9:17pm UTC](https://forum.bubble.io/t/regex-search-replace-extract-for-first-name-last-name/283777/1 "2023-09-17T21:17:50Z")

</div>

Hello!

Trying to filter out invalid first names/last names.

I understood from other posts I should use the :extract with Regex function (or find & replace and compare number of characters)

But for some reason, I can’t get either of these two functions to work

Here is the Regex pattern i’m using and the setup, and the result from my test

 ![Capture d’écran 2023-09-17 231459](https://us1.discourse-cdn.com/bubble/original/3X/d/a/da371fa5e91fb2055da823156569865a5135ce3f.png)

![Capture d’écran 2023-09-17 231444](https://us1.discourse-cdn.com/bubble/original/3X/5/c/5cc0561610342e8b183be42b3d8a6d30cecf5047.png)

Thanks for the help!

---

<div class="post-metadata">

**Author:** ![georgecollier](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/georgecollier/32/182327_2.png) [@georgecollier](https://forum.bubble.io/u/georgecollier)\
**Post date:** [September 17, 2023, 9:50pm UTC](https://forum.bubble.io/t/regex-search-replace-extract-for-first-name-last-name/283777/2 "2023-09-17T21:50:08Z")

</div>

> [@yann.amadieu](#):
>
> Trying to filter out invalid first names/last names.

What is an invalid first name or last name?

---

<div class="post-metadata">

**Author:** ![dorilama](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/dorilama/32/226878_2.png) [@dorilama](https://forum.bubble.io/u/dorilama)\
**Post date:** [September 17, 2023, 10:07pm UTC](https://forum.bubble.io/t/regex-search-replace-extract-for-first-name-last-name/283777/3 "2023-09-17T22:07:16Z")

</div>

bubble does not support specifying flags, and requires the regex without the surrounding slashes. (not `/asdf/u` but only `asdf`)  
From a user experience point of view trying to force a first/last name pattern is full of problems and edge cases. See [this interesting reading](https://design-system.service.gov.uk/patterns/names/) about it.
