Hi
I have a table full of regexes (like the one bellow)
part_match
^FF2
^FF2-0F4J
^FF2|FGD[12|21]FSFF
I need a query to retrieve the part_match of the BEST match for 'FF2-0F4J-YJKNC'
I tried going 'FF2-0F4J-YJKNC' regexp match_match ORDER BY length( part_match ) DESC and grab the first row returned, but will not work because this will return row 3 first but the best match is row
Does any one know how to solve this problem by only using a MYSQL query?
Note
Obviously this is an example, the actual table is huge and I need something works for any input
Thank you !!