You can use a pattern like '<title>(.*)</title>' and match it with a string.
local String = '<title>hello world</title>'
local res = string.match(String, '<title>(.*)</title>')
print(res)--hello world
Note & Edit: The * modifier will match 0 or more times, so naturally inputting '<title></title>' will return a blank string ('') instead of nil. if a nil result is desired you can use the + modifier.