Skip to content

Instantly share code, notes, and snippets.

@wingsline
Created January 3, 2013 05:54
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save wingsline/4441139 to your computer and use it in GitHub Desktop.
Save wingsline/4441139 to your computer and use it in GitHub Desktop.
Laravel: SQLite REGEXP
// create the function
DB::connection()->pdo->sqliteCreateFunction("REGEXP", "preg_match", 2);
// build a query
DB::table('tablename')->raw_where('REGEXP("#^[a-z]+$#iu", tablename.row)')->get();
@GonzaloGPF
Copy link

Thanks! Works perfectly!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment