7

I'm trying to build a search query to match whole words in SQLite and C# on Windows. When I run a query like this:

SELECT a, b FROM Events WHERE c REGEXP @SearchString;

Then:

cmd.Parameters.Add(new SQLiteParameter("@SearchString", 
"%[^a-zA-Z0-9]" + searchdata.SearchText + "[^a-zA-Z0-9]%"));

And when I call:

var r = cmd.ExecuteReader();

I get REGEXP no such function. I wonder how to activate REGEXP support and CASE SENSITIVE search.

Paul Exchange
  • 2,637
  • 3
  • 26
  • 33

2 Answers2

5

I've got it! The problem was that I didn't define the REGEXP function. I've got from here: here a definition for C#.

Community
  • 1
  • 1
Paul Exchange
  • 2,637
  • 3
  • 26
  • 33
0

You shouldn't need the %. That is only for LIKE.

Daniel A. White
  • 187,200
  • 47
  • 362
  • 445