Jump to content

zdp

New Members
  • Posts

    1
  • Joined

  • Last visited

    Never

Everything posted by zdp

  1. Ok, so I wasn't able to find an issue similar to what I've been struggling with, so I apologize if it has been answered or is really easy :-P So here's my problem: I am importing a file using file_get_contents and want to replace any text that is inside of a double quote unless the double quote is in a single quote itself. The regex I have now will do the former, but not the latter. The regex I am using is '/"(.+?)"/s', and I am using preg_replace. Here are 2 examples and what their expected results should be: ##div('$$title or "$$title"'); // current results: '$$title or "$view->title"' // expected results: '$$title or "$$title"' ##div("$$title or '$$title'"); // current results: "$view->title or '$view->title'" // expected results: "$view->title or '$view->title'" If you notice the first example, the single quoted string should be ignored, whereas right now it is not. That's what I need to fix. Let me know if this makes sense. Thanks!
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.