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

Martin Dimitrov <>
Thu Feb 9 17:00:10 CET 2012


Thanks but where do you put this pattern?

On 2/9/2012 5:48 PM, Ulf Wiger wrote:
> 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
>> 
>> http://erlang.org/mailman/listinfo/erlang-questions




More information about the erlang-questions mailing list