Thanks Ralf,

>select * from t where filepath regexp '/MyMovie(\.[^\.]+)*$';

Will this query use index, if we had one, on filepath?

Regards,

Bharath

On 1/25/08 5:22 PM, "Ralf Junker" <[EMAIL PROTECTED]> wrote:

> Hello Bharath Booshan L,
> 
> yes, with SQLiteSpy you can do this:
> 
> drop table if exists t;
> create table t (id integer primary key, filepath text);
> insert into t values (1, '/Volumes/Backup/MyMovies/MyMovie.mp4');
> insert into t values (2, '/Volumes/Backup/MyMovies/Hello.mp4');
> insert into t values (3, '/Volumes/Tiger/MyMovie.mov');
> select * from t where filepath regexp '/MyMovie(\.[^\.]+)*$';
> 
> Ralf
> 
>> I have to perform a search something similar to this
>> 
>>  ID     FilePath
>>   1      /Volumes/Backup/MyMovies/MyMovie.mp4
>>   2      /Volumes/Backup/MyMovies/Hello.mp4
>>   3      /Volumes/Tiger/MyMovie.mov
>> 
>> 
>> Search for file name MyMovie should retrieve
>>    
>>   ID     FilePath
>>   1      /Volumes/Backup/MyMovies/MyMovie.mp4
>>   3      /Volumes/Tiger/MyMovie.mov
>> 
>> 
>> To simplify, I am searching for a file name from a collection of absolute
>> file paths.
>> 
>> How can I achieve this in SQLite?
>> 
>> Is there anyways I can use regular expression in a query to perform string
>> matching.
> 
> 
> -----------------------------------------------------------------------------
> To unsubscribe, send email to [EMAIL PROTECTED]
> -----------------------------------------------------------------------------
> 
> 



-----------------------------------------------
Robosoft Technologies - Come home to Technology

Disclaimer: This email may contain confidential material. If you were not an 
intended recipient, please notify the sender and delete all copies. Emails to 
and from our network may be logged and monitored. This email and its 
attachments are scanned for virus by our scanners and are believed to be safe. 
However, no warranty is given that this email is free of malicious content or 
virus.



-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to