my $sth=$dbh->prepare('SELECT * FROM foo WHERE something REGEXP ? ORDER BY fate;'); my $re='(^|\;)' . $input . '(\;|$)'; $sth->execute($re);