[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Preg-match alternative in Lua
- From: Sandeep Ghai <sandeep.ghai92@...>
- Date: Tue, 5 Jun 2012 11:23:22 +0530
>> Hello Everyone,
>> I just come across the 'preg-match' [1] function of PHP.
>> Do we have similar function in Lua as well?
> Is there a significant difference between preg-match and string:match? Because if not, then..
Specifically Preg-match is for matching one value or one set of data
with a given pattern..
and what I tried with string.match, it matches the pattern and I am
unable to extract a set of data in the matched pattern.
(There could be my fault too,due to less knowledge about using
functions, And I am here on this mailing list to learn.)
> ...Tim's advice from last time you asked was worth following!
No doubt, it worked for me.
But After using string.match function, I always need to use string.sub
function also to extract the required set of values,
But thats the wrong approach ,IMO.
I just wanted something better to improve my script, Thats why I tried
to find better functions.
And please be easy on me, I always surf Google before asking anything here.
--
Sandeep Ghai
blog: http://sandeepghai.wordpress.com