regular expression matching on encrypted data using secure multiparty computation
there are some special constructions that could be used. for example see this paper of florain kerschbaum (freely available version).
also, you can use some secure DFA evaluation protocols, as any regex can be represented as a DFA.

what you have proposed is not secure and the servers can learn lots of information.