[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: multiline rex.match
- From: Yehuda Eisenstark <yudieisenstark@...>
- Date: Thu, 16 Dec 2010 17:04:28 +0200
I have a variable that contains text over multiple lines, e.g.:
local string = <part>
When there are no spaces / new lines in the string a simple rex.match, like the following works:
local number = rex.match(string, "<part>(.*?)</part>")
But once there are new lines the regex breaks, even when I add .* to the regex. How can I parse out text on multi-line searches?
Also as an aside, as I'm new to Lua. In other languages I've always tried to use very descriptive variable names. In a lot of the lua examples I've seen, variable names are extremely short, like one letter. Is this just a matter of style or are there good reasons to use shorter variable names?