Reputation: 163
How do I serialize the following url with lua?
Is it possible with the "match"?
http://example.com/go.php?user=stack&pass=overflow
Domain: example.com
User: stack
Pass: overflow
Upvotes: 0
Views: 631
Reputation: 72312
Try this:
s="http://example.com/go.php?user=stack&pass=overflow"
d,u,p=s:match("http://(.+)/.*user=(.-)&pass=(.+)")
print(d,u,p)
Upvotes: 1