Mercurial Hosting > luan
comparison src/luan/modules/StringLuan.java @ 1555:1b397a949791
minor
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Tue, 06 Oct 2020 20:53:43 -0600 |
parents | 01e38174d580 |
children | b89212fd04b5 |
comparison
equal
deleted
inserted
replaced
1554:83249ce59d13 | 1555:1b397a949791 |
---|---|
125 return rtn; | 125 return rtn; |
126 } | 126 } |
127 | 127 |
128 public static LuanFunction gmatch(String s,String pattern) throws LuanException { | 128 public static LuanFunction gmatch(String s,String pattern) throws LuanException { |
129 Utils.checkNotNull(s); | 129 Utils.checkNotNull(s); |
130 Utils.checkNotNull(pattern,2); | |
130 final Matcher m = Pattern.compile(pattern).matcher(s); | 131 final Matcher m = Pattern.compile(pattern).matcher(s); |
131 return new LuanFunction(false) { | 132 return new LuanFunction(false) { |
132 @Override public Object call(Object[] args) { | 133 @Override public Object call(Object[] args) { |
133 if( !m.find() ) | 134 if( !m.find() ) |
134 return null; | 135 return null; |