String.gsub help

Hello!

I’m currently having difficulty finding out how I’d go about using gsub on this string. Basically, it determines the game version but I want it to look more pleasant.

Essentially what the string looks like is:

'<GAME_VERSION v0.9.9>'

The issue is that I’m not sure how to get rid of the <GAME_VERSION v and the > without doing two separate gsubs. Any ideas?

I’ve tried doing a couple things but I honestly have no idea what I’m doing:

string:gsub('(<GAME_VERSION)(>)', '')
string:gsub('[<GAME_VERSION][v>]', '')
1 Like
print(string.match(String, '<GAME_VERSION v(.+)>'))
print(String:match('<GAME_VERSION v(.+)>'))

I would use string.match for this

1 Like
print(string.gsub(strings, "<GAME_VERSION v(.+)>", "%1"))

If you wanted to continue using gsub for clarification purposes.