Author Topic: strfind Question  (Read 1593 times)

0 Members and 1 Guest are viewing this topic.

Offline kepp

  • Scripter
  • King
  • ******
  • Posts: 790
  • Karma: +2/-0
strfind Question
« 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+)")
Guarding    

PtokaX forum

strfind Question
« on: 29 January, 2004, 22:05:13 »

Offline kepp

  • Scripter
  • King
  • ******
  • Posts: 790
  • Karma: +2/-0
(No subject)
« Reply #1 on: 29 January, 2004, 22:08:06 »
ah, never mind, figured it out :)
Guarding    

Offline VidFamne

  • Triple Ace
  • **
  • Posts: 173
  • Karma: +2/-0
(No subject)
« Reply #2 on: 29 January, 2004, 23:07:13 »
What did you use?
was it;
Code: [Select]
local s,e,version = strfind(DATA,"V:(%w.%w+)") I'm curious
« Last Edit: 29 January, 2004, 23:07:50 by VidFamne »

Offline kepp

  • Scripter
  • King
  • ******
  • Posts: 790
  • Karma: +2/-0
(No subject)
« Reply #3 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+)")
Guarding    

Offline plop

  • Forum God
  • ****
  • Posts: 2 464
  • Karma: +37/-0
(No subject)
« Reply #4 on: 30 January, 2004, 00:35:24 »
Quote
Originally 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
http://www.plop.nl lua scripts/howto\'s.
http://www.thegoldenangel.net
http://www.vikingshub.com
http://www.lua.org

>>----> he who fights hatred with hatred, drives the spreading of hatred <----<<

PtokaX forum

(No subject)
« Reply #4 on: 30 January, 2004, 00:35:24 »