Get Text Inbetween Characters

I’m just wondering if there is a easier way than my current method to get text in between two characters

like this:

i want to get the characters inbetween “a”, so the function should hopefully return “bb”

You can use regex:

local testStr = "abbghsa"

print(string.match(testStr, "a(.-)a"))

Now im on mobile rn so this might not work (also am not the best with regex but if I remember correctly that’s how to do it) anyways, regex is what you want

1 Like

Works, thankyou, is it possible to do it without knowing the character it is inbetween? ( this is just me wondering by the way )

I don’t think so but I might just not get what you are asking

It’s alright don’t worry

i hate the limit :frowning_face: