Re: [sqlite] Using stored Regular Expressions to match given String

2011-01-13 Thread Bruno Augusto
Sorry for the mistake about the images. The current version is: http://img15.imageshack.us/img15/7747/44037591.png About the problem, many thanks for all the explanations about the way SQLITE deals with Regular Expressions. It worked perfectly. If interested to anyone (as part of PHP routine):

Re: [sqlite] Using stored Regular Expressions to match given String

2011-01-12 Thread Simon Slavin
On 12 Jan 2011, at 9:42pm, Bruno Augusto wrote: > SELECT `Application`, `Class`, `Method`, `RequiredParams`, `OptionalParams` > FROM `Routes` WHERE `RequestMethod` = "GET" AND "/" LIKE `URI` Just a note that the characters in the line I quoted above are directional quotes. The character you're

Re: [sqlite] Using stored Regular Expressions to match given String

2011-01-12 Thread Igor Tandetnik
On 1/12/2011 4:42 PM, Bruno Augusto wrote: > So, it would be: > > SELECT `Application`, `Class`, `Method`, `RequiredParams`, `OptionalParams` > FROM `Routes` WHERE `RequestMethod` = "GET" AND "/" LIKE `URI` > > As "GET" is the default Request Method, and the string I'm passing is a > single slash.

Re: [sqlite] Using stored Regular Expressions to match given String

2011-01-12 Thread Bruno Augusto
So, it would be: SELECT `Application`, `Class`, `Method`, `RequiredParams`, `OptionalParams` FROM `Routes` WHERE `RequestMethod` = "GET" AND "/" LIKE `URI` As "GET" is the default Request Method, and the string I'm passing is a single slash. If so, I didn't receive any result when, if I use PHP

Re: [sqlite] Using stored Regular Expressions to match given String

2011-01-12 Thread Simon Slavin
On 12 Jan 2011, at 9:14pm, Bruno Augusto wrote: > When querying, I will NOT pass the Regular Expression, I will pass the > string to be used as target for the stored patterns. The previous responses were fine. Operators take more than one operand, and you will need to specify all of them each

Re: [sqlite] Using stored Regular Expressions to match given String

2011-01-12 Thread Bruno Augusto
Maybe I'm doing some kind of confusion or I can't express myself entirely. Please take a look in the image: http://img268.imageshack.us/img268/5526/74988733.png This is the structure of database that will be used as part of a MVC Router, part of a framework I'm developing. The only column that i

Re: [sqlite] Using stored Regular Expressions to match given String

2011-01-12 Thread Simon Slavin
I like how this question got three completely different answers in less than 90 minutes. Simon. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Using stored Regular Expressions to match given String

2011-01-12 Thread Igor Tandetnik
Bruno Augusto wrote: > So, I know I need a user function to use the REGEXP operator. But most of > the implementations I'd found (in PHP, I have to say) requires TWO > parameters, the Regular Expression and the string to match. That's not a problem. SQLite takes an expression of the form a REGEX

Re: [sqlite] Using stored Regular Expressions to match given String

2011-01-12 Thread Simon Slavin
On 12 Jan 2011, at 11:40am, Bruno Augusto wrote: > I hope I'm doing the right thing. I never used Mailing Lists before. So far, so good. > So, I know I need a user function to use the REGEXP operator. But most of > the implementations I'd found (in PHP, I have to say) requires TWO > parameters,

Re: [sqlite] Using stored Regular Expressions to match given String

2011-01-12 Thread Michele Pradella
it's possible to use REGEXP in a select statement like this: SELECT * from table_name WHERE Path REGEXP 'regular expression' before you can use REGEXP you have to use the function sqlite3_create_function(db, "regexp", 2, SQLITE_ANY,(void*)pAppPointer,&sqlite3_RegExpFunction,0,0) to tell SQLITE t

[sqlite] Using stored Regular Expressions to match given String

2011-01-12 Thread Bruno Augusto
Hi, I hope I'm doing the right thing. I never used Mailing Lists before. So, I know I need a user function to use the REGEXP operator. But most of the implementations I'd found (in PHP, I have to say) requires TWO parameters, the Regular Expression and the string to match. I created an SQLITE da