I am using this to match the text which appears between two words:

a1 = "apple"
a2 = "bear"
match_pattern = string.format('%s(.*)%s', a1, a2)
str = string.match(str, match_pattern)

How can I make a match between the start of the string and a number or a number and the end of the string?

lua
Edit
Report