[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Need help building a regexp pattern
- From: Theodor-Iulian Ciobanu <tciobanu@...>
- Date: Fri, 27 Oct 2006 09:10:32 +0300
Hello Lua,
Most of the questions I asked here are related to parsing of logs, and this one makes no exception. I'm blaming it on me still not having a good grasp of the language, but I do love its speed and versatility. ('Cause I don't think I ever mentioned how much I *enjoy* working with lua - great job, everybody!)
To get back on topic, I have a log with lines that would match either the pattern "(.)%s*(.-)%s*(.+)" or just "(.-)%s*(.+)". What I'd like to be able to do is build a single pattern with three captures, the first one being nil for the second type of strings. Is it possible? (Currently I'm doing a string.match with the first pattern and if that fails then I do a second one with the latter pattern - and this is the optimization I'd like to do, have only one string.match())
--
Theodor-Iulian Ciobanu
jr Virus Researcher
e-mail: tciobanu@bitdefender.com
-----------------------------------------
Secure your every bit
-----------------------------------------
--
This message was scanned for viruses by BitDefender for Linux Mail Servers.
For more information please visit http://www.bitdefender.com/