我有几行需要更新,其中双撇号在某些位置被替换,并且被删除而不是其他位置。正则表达式并用preg_replace替换双撇号
所以:
(2, 'Name 2', '', 8, 0, 0, 1, 'Info blah blah', 0, 4),
(3, 'Name 3', 'A normal bit of information', 8, 1, 0, 1, 'Info more blah', 0, 4),
(45, 'Name 45', 'Info with '' in it like it''s stuff', 356, 10, 1, 1, '', 0, 9)
需求,成为:
(2, 'Name 2', '', 8, 0, 0, 1, 'Info blah blah', 0, 4),
(3, 'Name 3', 'A normal bit of information', 8, 1, 0, 1, 'Info more blah', 0, 4),
(45, 'Name 45', 'Info with \'\' in it like it\'\'s stuff', 356, 10, 1, 1, '', 0, 9)
在尝试各种方法,我管理 '与\' 更新所有 '\',然后打破以后使用的功能。
哪里撇号?我所看到的都是单独的字符。 – sln 2011-02-13 00:14:44