[NOTHING CHANGED] Move to maven and massive clean and fixup #93

Closed
farmboy0 wants to merge 43 commits from farmboy0/master into master
5 changed files with 5 additions and 0 deletions
Showing only changes of commit 560a4694e4 - Show all commits

View File

@@ -640,6 +640,8 @@ public class StringLib extends TwoArgFunction {
int lastmatch = -1; /* end of last match */
LuaValue repl = args.arg(3);
int max_s = args.optint(4, srclen+1);
if (max_s < 0)
max_s = srclen+1;
final boolean anchor = p.length() > 0 && p.charAt(0) == '^';
Buffer lbuf = new Buffer(srclen);

View File

@@ -21,6 +21,9 @@ print( string.match( "abbaaababaabaaabaa", "b(a*)()b", 12 ) )
print( string.byte("hi", -3) )
print( string.gsub("ABC ABC ABC", "ABC", "DEF", -1) )
print( string.gsub("ABC ABC ABC", "ABC", "DEF", 0) )
print( string.gsub("ABC ABC ABC", "ABC", "DEF", 2) )
print( string.gsub("ABC", "@(%x+)", function(s) return "|abcd" end) )
print( string.gsub("@123", "@(%x+)", function(s) return "|abcd" end) )
print( string.gsub("ABC@123", "@(%x+)", function(s) return "|abcd" end) )