# Pattern Capture Token Filter giving same start and end offset position

**URL:** <https://discuss.elastic.co/t/pattern-capture-token-filter-giving-same-start-and-end-offset-position/301858>\
**Category:** Elasticsearch\
**Created:** [April 7, 2022, 11:46am UTC](https://discuss.elastic.co/t/pattern-capture-token-filter-giving-same-start-and-end-offset-position/301858 "2022-04-07T11:46:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dishant.sharma](https://avatars.discourse-cdn.com/v4/letter/d/90db22/32.png) [@dishant.sharma](https://discuss.elastic.co/u/dishant.sharma)\
**Post date:** [April 7, 2022, 11:46am UTC](https://discuss.elastic.co/t/pattern-capture-token-filter-giving-same-start-and-end-offset-position/301858/1 "2022-04-07T11:46:34Z")

</div>

I was following the Pattern Capture Token Filter example on the Elasticsearch 5.6 documentation. I tried running one example on my local elastic instance. I got the tokens but they all are showing the same start and end offsets. I know due to the default behaviour of Pattern Capture Token Filter, I am getting all the tokens with same start and end offsets. But, my question is that is there a work around by which I can get the start and end offsets or position of the generated tokens from the matched string?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [April 7, 2022, 11:46am UTC](https://discuss.elastic.co/t/pattern-capture-token-filter-giving-same-start-and-end-offset-position/301858/2 "2022-04-07T11:46:34Z")

</div>

Elasticsearch 5.6 is [EOL](https://www.elastic.co/support/eol) and no longer supported. Please upgrade ASAP.

(This is an automated response from your friendly Elastic bot. Please report this post if you have any suggestions or concerns :elasticheart: )

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [May 5, 2022, 11:47am UTC](https://discuss.elastic.co/t/pattern-capture-token-filter-giving-same-start-and-end-offset-position/301858/3 "2022-05-05T11:47:20Z")

</div>

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