PtokaX forum

Development Section => Your Developing Problems => Topic started by: kepp on 29 January, 2004, 22:05:13

Title: strfind Question
Post by: kepp on 29 January, 2004, 22:05:13
I want to get the verision out from a users infostring, but there is a dot after the digit, I can't seem to find a way to do this correct.

local s,e,version = strfind(DATA,"V:(%d+)")
Title:
Post by: kepp on 29 January, 2004, 22:08:06
ah, never mind, figured it out :)
Title:
Post by: VidFamne on 29 January, 2004, 23:07:13
What did you use?
was it;local s,e,version = strfind(DATA,"V:(%w.%w+)") I'm curious
Title:
Post by: kepp on 29 January, 2004, 23:19:17
well, i didn't know exactly how to do so first it was
local s,e,version = strfind(DATA,"V:(%d).(%d+)")

Which ofcorse didn't work..
then i took another look in the manual and ended up with

local s,e,version = strfind(DATA,"V:(%d.%d+)")
Title:
Post by: plop on 30 January, 2004, 00:35:24
QuoteOriginally posted by kepp
well, i didn't know exactly how to do so first it was
local s,e,version = strfind(DATA,"V:(%d).(%d+)")

Which ofcorse didn't work..
then i took another look in the manual and ended up with

local s,e,version = strfind(DATA,"V:(%d.%d+)")
check my just posted pattern matching part 2, you can do this with magic.
lets see if i explained it all correct. lol

plop