Permalink
Browse files

string_ext: remove finds; map should be used with string.find instead

  • Loading branch information...
1 parent 2b3c300 commit 5a62e3ee7ad2514b681ff6f348c43b797088b089 @rrthomas rrthomas committed Sep 11, 2012
Showing with 0 additions and 20 deletions.
  1. +0 −20 src/string_ext.lua
View
@@ -209,26 +209,6 @@ function tfind (s, p, init, plain)
return pack (p.find (s, p, init, plain))
end
---- Do multiple <code>find</code>s on a string.
--- @param s target string
--- @param p pattern
--- @param init start position (default: 1)
--- @param plain inhibit magic characters (default: nil)
--- @return list of <code>{from, to; capt = {captures}}</code>
-function finds (s, p, init, plain)
- init = init or 1
- local l = {}
- local from, to, r
- repeat
- from, to, r = tfind (s, p, init, plain)
- if from ~= nil then
- table.insert (l, {from, to, capt = r})
- init = to + 1
- end
- until not from
- return l
-end
-
--- Split a string at a given separator.
-- FIXME: Consider Perl and Python versions.
-- @param s string to split

0 comments on commit 5a62e3e

Please sign in to comment.