print("request=["..request.."]")
_, _, method, path, vars = string.find(request, "([A-Z]+) (.+)?(.+) HTTP");
print("method=", "["..method.."]")
print("path=", "["..path.."]")
print("vars=", "["..vars.."]")
request= [GET / HTTP/1.1]
and the results are:
method= nil
path= nil
vars= nil
Why is method nil. I can't figure out why it is not "GET"
The first capure is ([A-Z]+) so according the rules of pattern-matching it should be "GET".
Please enlighten me !