# REGEX Issue to extract data from a string

**URL:** <https://community.tulip.co/t/regex-issue-to-extract-data-from-a-string/13670>\
**Category:** Support, Troubleshooting, & Help\
**Tags:** triggers, regex, expression-editor\
**Created:** [January 30, 2025, 3:31pm UTC](https://community.tulip.co/t/regex-issue-to-extract-data-from-a-string/13670 "2025-01-30T15:31:24Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![paul.genoud](https://avatars.discourse-cdn.com/v4/letter/p/f14d63/32.png) [@paul.genoud](https://community.tulip.co/u/paul.genoud)\
**Post date:** [January 30, 2025, 3:31pm UTC](https://community.tulip.co/t/regex-issue-to-extract-data-from-a-string/13670/1 "2025-01-30T15:31:24Z")

</div>

Hi everyone,

Here is my use case.  
I’m scanning barcodes with the data “A0000015665279” inside it.  
I want to extract from this code only the part “15665279”.

I tried to use the following REGEX to do this : /[A-Z]0\*(\d+)/

I tried to use the REGEX\_MATCH function in TULIP :  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/agilemfg/optimized/2X/c/c1c4fe1549c3733344a6552eccc5f1b362633316_2_690x37.png)

But I don’t have any outputs in my variable.

Any advice on what I’m doing wrong ?

Thanks,  
Paul

---

<div class="post-metadata">

**Author:** ![ta-aoki](https://avatars.discourse-cdn.com/v4/letter/t/a587f6/32.png) [@ta-aoki](https://community.tulip.co/u/ta-aoki)\
**Post date:** [January 31, 2025, 12:01am UTC](https://community.tulip.co/t/regex-issue-to-extract-data-from-a-string/13670/2 "2025-01-31T00:01:46Z")

</div>

I do not know if this is expected behavior, but it seems like you should either try these

- ‘[A-Z]0\*([1-9]+)’
- ‘[A-Z]0\*(\d+)’

 ![image](https://us1.discourse-cdn.com/flex020/uploads/agilemfg/original/2X/4/40613fcb58150e8021595bffc6e37f917f48c2d5.png)

 ![image](https://us1.discourse-cdn.com/flex020/uploads/agilemfg/original/2X/5/5366c81ec5fcd2241887c26e430f29b3f84c3976.png)

It worked in my sandbox(r303.1)

---

<div class="post-metadata">

**Author:** ![ta-aoki](https://avatars.discourse-cdn.com/v4/letter/t/a587f6/32.png) [@ta-aoki](https://community.tulip.co/u/ta-aoki)\
**Post date:** [January 31, 2025, 12:04am UTC](https://community.tulip.co/t/regex-issue-to-extract-data-from-a-string/13670/3 "2025-01-31T00:04:07Z")

</div>

OK, this community post also seem to escape \ .  
You should either try

- ‘[A-Z]0\*([1-9]+)’
- ‘[A-Z]0\*(\\d+)’

Please note that you need **two** ‘\’ before ‘d’

---

<div class="post-metadata">

**Author:** ![ta-aoki](https://avatars.discourse-cdn.com/v4/letter/t/a587f6/32.png) [@ta-aoki](https://community.tulip.co/u/ta-aoki)\
**Post date:** [January 31, 2025, 12:23am UTC](https://community.tulip.co/t/regex-issue-to-extract-data-from-a-string/13670/4 "2025-01-31T00:23:51Z")

</div>

Maybe you would like to vote for this Product Suggestion!

> [@Add Unique Coloring for Escape Character Backslash](https://community.tulip.co/t/add-unique-coloring-for-escape-character-backslash/12744):
>
> An item which is not super obvious when using expressions is that the “\” character is actually an escape character. This is standard with strings, but for users who aren’t familiar with that convention it is not intuitive. This mainly shows up with Regular expressions, since all backslashes in the expression have to be doubled for the expression to run correctly. For example, see below: [image] It would be nice to have escape backslashes given a different color compared to normal text, to ma…

---

<div class="post-metadata">

**Author:** ![paul.genoud](https://avatars.discourse-cdn.com/v4/letter/p/f14d63/32.png) [@paul.genoud](https://community.tulip.co/u/paul.genoud)\
**Post date:** [February 3, 2025, 12:41pm UTC](https://community.tulip.co/t/regex-issue-to-extract-data-from-a-string/13670/5 "2025-02-03T12:41:27Z")

</div>

Hi @ta-aoki, thank you for the inputs ! The REGEX you sent are working perfectly 👍
