Answer the question
In order to leave comments, you need to log in
How to write a regular expression - searching for a value between commas?
$subject = "Website development,Website development,Website design,Website promotion,Website promotion,SEO website promotion,Website support";
$searchstring="motion"
$pattern = "/[,][a-zA-Za-zA-Z]*".$searchstring."[a-zA-Za-zA-Z]*[,]/";
preg_match($pattern, $subject, $matches, PREG_OFFSET_CAPTURE);
How to write an expression to return "Website promotion"?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question