# Backreference in ExtractString not Working?

**URL:** <https://community.eazybi.com/t/backreference-in-extractstring-not-working/14453>\
**Category:** Questions & Answers\
**Created:** [December 5, 2023, 3:04pm UTC](https://community.eazybi.com/t/backreference-in-extractstring-not-working/14453 "2023-12-05T15:04:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![aherz](https://community.eazybi.com/user_avatar/community.eazybi.com/aherz/32/10112_2.png) [@aherz](https://community.eazybi.com/u/aherz)\
**Post date:** [December 5, 2023, 3:04pm UTC](https://community.eazybi.com/t/backreference-in-extractstring-not-working/14453/1 "2023-12-05T15:04:41Z")

</div>

For testing I have this custom measure:

```auto
ExtractString('(xsd),(abc),(abc),(xyz)','.*\(([^,)]*)\),\(\1\).*',1)

```

According to the docu ExtractString uses java pattern matching and trying the same in java ([Online Compiler and Editor/IDE for Java, C, C++, PHP, Python, Ruby, Perl - Code and Run Online](https://www.jdoodle.com/online-java-compiler), replacing single ‘\’ by ‘\\’) or on ([https://regex101.com/](https://regex101.com/) for java8) yields the expected “abc” as result but when executed in an easzybi measure there is no result.

---

<div class="post-metadata">

**Author:** ![zane.baranovska](https://community.eazybi.com/user_avatar/community.eazybi.com/zane.baranovska/32/7209_2.png) [@zane.baranovska](https://community.eazybi.com/u/zane.baranovska)\
**Post date:** [December 8, 2023, 9:46am UTC](https://community.eazybi.com/t/backreference-in-extractstring-not-working/14453/2 "2023-12-08T09:46:46Z")

</div>

Hi @aherz,

Could you please clarify what is the objective for this calculation? What kind of data are expected to be input and what would yuo like to get as output?

Best,  
Zane / [support@eazyBI.com](mailto:support@eazyBI.com)

---

<div class="post-metadata">

**Author:** ![aherz](https://community.eazybi.com/user_avatar/community.eazybi.com/aherz/32/10112_2.png) [@aherz](https://community.eazybi.com/u/aherz)\
**Post date:** [December 11, 2023, 8:51am UTC](https://community.eazybi.com/t/backreference-in-extractstring-not-working/14453/3 "2023-12-11T08:51:28Z")

</div>

Hi Zane,

I want to find pairs of tuples in the string ‘(xsd),(abc),(abc),(xyz)’ that have the same content.  
So running the provided regexp on the provided string should yield “abc”, see here (group 1 on rhs is “abc”):

 ![image](https://community.eazybi.com/uploads/default/original/2X/6/647efec76f6e048b795e3e4a91f02b6683a37ca4.png)

So this seems to be a bug in ExtractString. The actual problem I am trying to solve in eazybi I solved already by some other means, I just wanted to report this potential bug.
