[erlang-questions] searching in an ETS table for substring

Ulf Wiger ulf@REDACTED
Thu Feb 9 16:48:06 CET 2012


If the key is a list (not a binary), you can use the pattern "foo" ++ '_'.

There is no equivalent syntax for binaries.

If the table is an ordered set, this search will be efficient, since it will use the bound prefix to narrow the search.

BR,
Ulf

On 9 Feb 2012, at 16:37, Martin Dimitrov wrote:

> Hello,
> 
> Is it possible to search in an ETS table for a key that starts with
> certain characters?
> Something equivalent to:
> 
> SELECT * FROM table WHERE name LIKE 'some%'
> 
> I read the documentation for select/2 and it says we can use as guards
> functions as is_* and the like.
> 
> Best regards,
> 
> Martin
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions




More information about the erlang-questions mailing list