从字符串中提取值并获取其内容

我正在使用LUA从一个长字符串中提取一个值。

字符串(已缩短)看起来像:

local input = "...</anno:rotation<anno:contentY>40.900000000000006</anno:contentY<..."

我正在寻找最快/最简单的方法来提取<anno:contentY></anno:contentY<之间的值。在这个例子中是'40.900000000000006'。

除了使用string.find获取起始和结束位置, 然后使用string.split有没有更好的方法?

点赞