File: call1.lua

package info (click to toggle)
lua-gtk 0.9%2B20100528-2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 2,176 kB
  • ctags: 1,934
  • sloc: ansic: 9,571; sh: 373; makefile: 241
file content (12 lines) | stat: -rwxr-xr-x 278 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
require "glib"

rex = glib.regex_new("^foo[bar]+", 0, 0, nil)

-- object-oriented version
ok, match = rex:match("fooabx", 0, true)
print(match:get_string())

-- function call version
ok, match = glib.regex_match(rex, "fooabx", 0, true)
print(glib.match_info_get_string(match))