I have a custom field for storing educational data. A person's degree is stored as either Btech or B.Tech or B.Tech. so what should I give in search option so that I can get all 3 in my result in a single search?
1 Answer
You can use basic pattern valid in LIKE
operator of sql where clause.
For Eg - Using %tech%
would result in all three rows.
Similarly you can use [
, ]
, and _
symbols.
To find more about search strings - see Pattern Matching in MySQL (AFAIK you can use only LIKE
patterns here not REGEXP
).
-
did you mean B%tech% in order not to get eg MATech as a result?– petednz - fuzion ♦Commented Jun 23, 2017 at 20:35
-
yes, that would work,
B%tech%
will list any value starting withB followed by some chars and then tech <some chars>
which will exclude MATech from the result Commented Jun 25, 2017 at 6:22