How to trim text from word to word in Bubble.io?

I’m trying to create a function in Bubble.io that will allow me to trim a string of text from one word to another.
For example, if I have the input text “the quick brown fox jumps over the lazy dog”, I want to be able to trim it to “quick brown fox jumps” by specifying that I want to trim from the word “quick” to the word “jumps”.

Hi there, @OussMark… I don’t pretend to be an expert on regex, but I made an example that has an input for the full string, an input for the word to trim from, and an input for the word to trim to. With those inputs in place, a text element with the following expression produces the desired result of trimming “the quick brown fox jumps over the lazy dog” to “quick brown fox jumps” when the words “quick” and “jumps” are entered into the second and third inputs, respectively.

Maybe a regex expert will come along and provide a better or more correct suggestion, but again, what I am showing there does appear to do what you described.

Hope this helps.

Best…
Mike