lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


gsub() has a problem with \000

~>lua                                                           
Lua 4.0  Copyright (C) 1994-2000 TeCGraf, PUC-Rio
> x="L\000a"
> write(gsub(x,"\000","u"),"\n")
uLuuau



~>lua                                                                   
Lua 4.0  Copyright (C) 1994-2000 TeCGraf, PUC-Rio
> write( gsub("a\002b","[\001-\031]",".") ,"\n")
a.b
> write( gsub("a\002b","[\000-\031]",".") ,"\n")
error: malformed pattern (missing `]')
stack traceback:
   1:  function `gsub' [C]
   2:  main of string "write( gsub("a\002b","[\000-\031]",".") ,"\..." at
line 1
> 

Regards
Vagn Johansen