Author Topic: lua regex  (Read 2998 times)

0 Members and 1 Guest are viewing this topic.

Offline Hamachi

  • Forum Ace
  • *****
  • Posts: 88
  • Karma: +0/-7
lua regex
« on: 03 June, 2011, 14:34:16 »
test = "lua regex test"
local q = test:find("^(php|lua)") --(php|lua)

some there can help me whit that, it dont works :(

it is only an example, but i dont understand why it nok work, hsall use it in some code i are working one :(

PtokaX forum

lua regex
« on: 03 June, 2011, 14:34:16 »

Offline PPK

  • Administrator
  • Emperor
  • *****
  • Posts: 1 481
  • Karma: +209/-22
  • PtokaX developer
Re: lua regex
« Reply #1 on: 03 June, 2011, 15:45:44 »
You should read Lua manual  ;) It is not regex (regex library is bigger than whole Lua), they call it pattern matching and it's different than regex :-\
"Most of you are familiar with the virtues of a programmer. There are three, of course: laziness, impatience, and hubris." - Larry Wall

Offline Hamachi

  • Forum Ace
  • *****
  • Posts: 88
  • Karma: +0/-7
Re: lua regex
« Reply #2 on: 03 June, 2011, 16:23:39 »
ok hehe have i do it in lua ?
test = "lua"
test.find(test|lua|php|java)

Offline Hamachi

  • Forum Ace
  • *****
  • Posts: 88
  • Karma: +0/-7
Re: lua regex
« Reply #3 on: 03 June, 2011, 21:21:27 »
I dont understand the lua way, pls help me.

thansk :D

Offline bastya_elvtars

  • Forum God
  • ****
  • Posts: 3 752
  • Karma: +173/-7
  • The rock n' roll doctor
    • The FreshStuff3 Site
Everything could have been anything else and it would have just as much meaning.

PtokaX forum

Re: lua regex
« Reply #4 on: 04 June, 2011, 11:37:47 »