Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

zubairmohsin's avatar

Regex covert string formula to mysql LIKE search query

Regex how to convert string formula into MySQL LIKE search query in PHP?

What is the best way to convert this string formula into MySQL LIKE search query in PHP?

Example Input:

(Business Intelligence) AND ((Business Objects Specialist) OR Cognos Impromptu OR (Crystal Reports) OR (Datawarehousing) OR (PowerBI) OR (SSAS) OR (SSIS) OR (SSRS))

Expected output:

(column LIKE '%Business Intelligence%') AND ((column LIKE '%Business Objects Specialist%') OR (column LIKE '%Crystal Reports%') OR (column LIKE '%Datawarehousing%'))

Other possible inputs:

  • dotNET AND PHP

  • (Functioneel-Applicatie-Beheer) OR (Technisch-Applicatiebeheer)

  • (msSQL-dba) OR (Oracle)

  • (Delphi)

0 likes
0 replies

Please or to participate in this conversation.