{"action":"closed","issue":{"url":"https://api.github.com/repos/harrydeluxe/php-liquid/issues/27","labels_url":"https://api.github.com/repos/harrydeluxe/php-liquid/issues/27/labels{/name}","comments_url":"https://api.github.com/repos/harrydeluxe/php-liquid/issues/27/comments","events_url":"https://api.github.com/repos/harrydeluxe/php-liquid/issues/27/events","html_url":"https://github.com/harrydeluxe/php-liquid/issues/27","id":54763931,"number":27,"title":"Quotes (escaped) inside \"filtered\" text or inside a filter's arguments","user":{"login":"dovid","id":1697677,"avatar_url":"https://avatars.githubusercontent.com/u/1697677?v=3","gravatar_id":"","url":"https://api.github.com/users/dovid","html_url":"https://github.com/dovid","followers_url":"https://api.github.com/users/dovid/followers","following_url":"https://api.github.com/users/dovid/following{/other_user}","gists_url":"https://api.github.com/users/dovid/gists{/gist_id}","starred_url":"https://api.github.com/users/dovid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dovid/subscriptions","organizations_url":"https://api.github.com/users/dovid/orgs","repos_url":"https://api.github.com/users/dovid/repos","events_url":"https://api.github.com/users/dovid/events{/privacy}","received_events_url":"https://api.github.com/users/dovid/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-01-19T13:34:34Z","updated_at":"2015-01-27T14:19:10Z","closed_at":"2015-01-27T14:19:10Z","body":"Example of trying to filter some text that has double escaped quotes inside of it:\r\n\r\n`{{ \"let's try some \\\"quoted\\\" text\" | my_filter }}`\r\n\r\nExample of trying to filter some text using an argument that has double escaped quotes inside of it:\r\n\r\n`{{ \"text\" | my_filter: \"let's try some \\\"quoted\\\" argument\" }}`\r\n\r\nThese are scenarios that I have come across and it appears that the text and argument are both cut off at the first backslash `\\` because both `'QUOTED_STRING' => '\"[^\"]*\"|\\'[^\\']*\\''` and\r\n`'QUOTED_STRING_FILTER_ARGUMENT' => '\"[^\":]*\"|\\'[^\\':]*\\'',` are greedy and stop after the first double quote \" they find.\r\n\r\nIt seems that something like this might be a solution:\r\n\r\nIn `\\Liquid\\Liquid` change `QUOTED_STRING` and `QUOTED_STRING_FILTER_ARGUMENT` as follows:\r\n\r\n~~~\r\n'QUOTED_STRING' => '\"[^\"\\\\\\\\]*(?:\\\\\\\\.[^\"\\\\\\\\]*)*\"|\\'[^\\'\\\\\\\\]*(?:\\\\\\\\.[^\\'\\\\\\\\]*)*\\'',\r\n'QUOTED_STRING_FILTER_ARGUMENT' => '\"[^\"\\\\\\\\]*(?:\\\\\\\\.[^\"\\\\\\\\]*)*\"|\\'[^\\'\\\\\\\\]*(?:\\\\\\\\.[^\\'\\\\\\\\]*)*\\'',\r\n~~~\r\n\r\nThanks @bigwhoop for help on this.\r\n"}}