# KeepBetween function - It looks like there is a bug

**URL:** <https://community.easymorph.com/t/keepbetween-function-it-looks-like-there-is-a-bug/2995>\
**Category:** Support\
**Created:** [September 4, 2021, 5:29pm UTC](https://community.easymorph.com/t/keepbetween-function-it-looks-like-there-is-a-bug/2995 "2021-09-04T17:29:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ilya\_Karimoff](https://community.easymorph.com/user_avatar/community.easymorph.com/ilya_karimoff/32/1403_2.png) [@Ilya\_Karimoff](https://community.easymorph.com/u/Ilya_Karimoff)\
**Post date:** [September 4, 2021, 5:29pm UTC](https://community.easymorph.com/t/keepbetween-function-it-looks-like-there-is-a-bug/2995/1 "2021-09-04T17:29:08Z")

</div>

Hello, dear EasyMorph team!

Unexplained function results have been crossed out,  
Expected results are marked with a plus

 ![image](https://community.easymorph.com/uploads/default/original/2X/6/63f84da10bd216d199907dc710377162c984d0b4.png)

---

<div class="post-metadata">

**Author:** ![roberto](https://community.easymorph.com/user_avatar/community.easymorph.com/roberto/32/8595_2.png) [@roberto](https://community.easymorph.com/u/roberto)\
**Post date:** [September 6, 2021, 7:14am UTC](https://community.easymorph.com/t/keepbetween-function-it-looks-like-there-is-a-bug/2995/2 "2021-09-06T07:14:39Z")

</div>

Hello Ilya,

In the EasyMorph Help for the Keepbetween function ([KeepBetween(text, keep\_start, keep\_end) [EasyMorph Help]](https://help.easymorph.com/doku.php?id=syntax:functions:keepbetween)), the following is stated:

> - If _keep\_start_ is not found within _text_, all text from the start of _text_ to _keep\_end_.
> - If _keep\_end_ is not found within _text_, all text from the _keep\_start_ to the end of _text_ is returned.
> - If neither _keep\_start_ nor _keep\_end_ are found within _text_, an (empty) value is returned.

That is why you are getting those results. I would say you have two options here:

- If you are familiar with Regex, I would use RegexMatch ([RegExMatch(text, regex\_text) [EasyMorph Help]](https://help.easymorph.com/doku.php?id=syntax:functions:regexmatch&s%5B%5D=regex))

- Use keepAfter and keepBefore together, for example:  
` keepBefore(keepAfter([Column 1],"src="&char(34)),char(34))`  
([KeepAfter(text, after\_string) [EasyMorph Help]](https://help.easymorph.com/doku.php?id=syntax:functions:keepafter&s%5B%5D=keepafter))  
([KeepBefore(text, before\_string) [EasyMorph Help]](https://help.easymorph.com/doku.php?id=syntax:functions:keepbefore))

Regards!

---

<div class="post-metadata">

**Author:** ![Ilya\_Karimoff](https://community.easymorph.com/user_avatar/community.easymorph.com/ilya_karimoff/32/1403_2.png) [@Ilya\_Karimoff](https://community.easymorph.com/u/Ilya_Karimoff)\
**Post date:** [September 6, 2021, 8:09am UTC](https://community.easymorph.com/t/keepbetween-function-it-looks-like-there-is-a-bug/2995/3 "2021-09-06T08:09:33Z")

</div>

Thanks Roberto! As a result, I decided to use the second option.
