-2

I don't know where i'm making mistake. Please Help.

   preg_match_all('`(?:[^,"]|"((?<=\)"|[^"])*")*`x', $string, $result);        

What will be the correct line?

naan
  • 1,481
  • 2
  • 11
  • 12

1 Answers1

1

You did not escape the backslash:

preg_match_all('`(?:[^,"]|"((?<=\\)"|[^"])*")*`x', $string, $result);   

Or, if you don't intend to match a backslash at all, you then have to omit it completely:

preg_match_all('`(?:[^,"]|"((?<=)"|[^"])*")*`x', $string, $result);   
Psi
  • 6,387
  • 3
  • 16
  • 26
  • I tried to do the first line means adding a backslash but it didn't helped although second line did helped. Thanks – naan May 02 '17 at 05:26