如果我有一个字符串,例如:
String 1 - http(s) URL之前的文本
String 2 - http(s) URL本身(包括所有参数)
String 3 - http(s) URL之后的文本
请注意,在"http"之前可能没有空格。谢谢!
怎么在Lua中解析这个字符串,以便我得到三个子字符串:This is a website, it is at
http://www.abc.com/post_id?id=123&key=456
, please visit it and let me know. Thanks
String 1 - http(s) URL之前的文本
String 2 - http(s) URL本身(包括所有参数)
String 3 - http(s) URL之后的文本
请注意,在"http"之前可能没有空格。谢谢!
(.-)
而不是(.+)
。 - lhfs
是可选的,因此匹配https
和http
两者 :-) - Egor Skriptunoff