在go中使用lua示例, 基于gopher-lua!
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

21 rinda
583 B

pirms 4 gadiem
  1. uniregexp= uniregexp or {}
  2. --[[
  3. exp:
  4. uniregexp.match("foo.*","seafood") => true nil
  5. uniregexp.match("bar.*","seafood") => false nil
  6. uniregexp.match("a(b","seafood") => false error parsing regexp: missing closing ): `a(b`
  7. --]]
  8. uniregexp.match = function(pattern, s)
  9. return go.uniregexp.Match(pattern, s)
  10. end
  11. --[[
  12. exp:
  13. quotemeta(`[foo]`) => `\[foo\]`
  14. --]]
  15. uniregexp.quotemeta = function(s)
  16. return go.uniregexp.QuoteMeta(s)
  17. end
  18. -- 其余api可以调用go.uniregexp.***** 参考go语言 regexp.Regexp类方法