I am looking for a method to match a question to some regular expression inside a database. So far as I will tell (although I am no expert), some DBMS like MySQL possess a regex option for searching, you are able to only make a move like:

Find all rows in Column 1 that match the regex during my query.

What I wish to have the ability to do may be the opposite, i.e.:

Find all rows in Column 1 so that the regex in Column 1 matches my query.

Simple example - say I'd a database structured like so:

| Column 1 |  Column 2 |
|  [a-z]+  |  whatever |
|  [\w]+   |  whatever |
|  [0-9]+  |  whatever |

Therefore if I queried "dog", I'd would like it to return the rows with [a-z]+ and [w]+, and when I queried 123, it might return the row with [-9]+.

Knowing of a method to do that in SQL, a brief Choose example or perhaps a link to a good example could be much appreciated.

For MySQL (and might be other databases too):

SELECT * FROM table WHERE "dog" RLIKE(`Column 1`)