Matching with SQL
I have a table called bannedNicks that contains only one column so far called "banned" with the type varchar(50).
Now in my C++ program I use this table to check if a nick is legal by sending a query like: Code:
SELECT count(banned) FROM bannedNicks WHERE banned="<nick>"; |
Code:
SELECT count(banned) FROM bannedNicks WHERE banned LIKE '%<chunk>%'; cover quite a few not too unusual nicks ;) If that doesn't QUITE do what you want you'll need to load the result table into some C++ data-structure and run patter- matching against that e.g. vector of strings ... Cheers, Tink |
Yes I was aware of the "LIKE" and "%" but the thing is that that does "the other way around". It's the post in the database that is the pattern and the nick is what should be matched. :/
|
so the database contains the regular expressions and you want to do the matching in C++?
|
Quote:
|
All times are GMT -5. The time now is 02:23 AM. |