openscad/openscad — Issue #81: add search() function
Author: clothbot
Created: 2012-02-04 04:08:21+00:00
State: open

I was in need of a search function similar to lookup but for searching strings and lists for matches and returning the index value(s) matched. I took a stab at it and came up with this builtin_search() in func.cc:

https://github.com/clothbot/openscad/blob/master/src/func.cc

I've been exercising my code with this:

https://github.com/clothbot/openscad/blob/master/testdata/scad/misc/search-tests.scad

I haven't quite got the hang of all the git forking, branching and pull requests across branch boundaries, but the changes to func.cc should be pretty self-contained and clear in any diffs you do.

Please consider pulling it into the master branch. Thanks!