edrikL / gears

Automatically exported from code.google.com/p/gears
2 stars 3 forks source link

Expose JavaScript regular expressions in SQLite. #632

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
SQLite can use syntax like:

   SELECT * FROM t WHERE c REGEXP 'blah[x-z]+';

This is translated internally to REGEXP(c, 'blah[x-z]+'), which is not
implemented by default, but which can be overridden by SQLite embedders.

It would be nice to expose the JavaScript implementation's regular
expression library to this.  Failing that, it might be nice to include pcre
or some other regular expression library.  Either way, it would be useful
if the library in question supported Unicode appropriately (I think using
the JavaScript implementation's regular expression library would be a good
win on this front).

Bonus points for allowing:

  db.execute("SELECT * FROM t WHERE c REGEXP ?", [/blah[x-z]+/]);

That would be super cool.  Also probably completely impossible.

Original issue reported on code.google.com by Scott.Hess on 1 Aug 2008 at 10:12

GoogleCodeExporter commented 9 years ago

Original comment by gears.te...@gmail.com on 1 Aug 2008 at 11:33

GoogleCodeExporter commented 9 years ago
+1!

Original comment by thatcher...@gmail.com on 2 Aug 2008 at 1:45

GoogleCodeExporter commented 9 years ago
*

Original comment by gpit...@gmail.com on 25 May 2009 at 2:00