Ok, so generally, when searching for a substring in a table, you can search for something similar using wildcards; i.e. `'%abc%' will return anything that contains that substring ('abc').
However, if I'm looking for a specific format (perhaps "abc123") can I use a regex match to search for the additional string data? Eg:
cmd.CommandText = "SELECT * FROM [tbl] WHERE [name] LIKE @Param;";
Regex r = "\d*";
cmd.Parameters.AddWithValue("@Param", "abc" + r);
This would then check all of your strings, and depending on the regex, it would compare the strings:
- 'abc123' - Match
- 'abcd123' - No match
Post note: I'm not really looking so much into the syntax of the regex right now, I'm more interested to know whether or not this kind of process is possible.