Regex to find commas outside double quote in php

前端 未结 2 466
春和景丽
春和景丽 2021-01-26 12:55

What I have found so far is this

preg_match_all(\"/\'[^\']+\'|[^,]+/\", $input, $output);

Its supposed to find commas outside simple quotes, i

2条回答
  •  终归单人心
    2021-01-26 13:21

    To match all the commas which was outside the single quotes and double quotes.

    (?s)(?:(?

    DEMO

提交回复
热议问题