- Output for 8.1.32, 8.2.0 - 8.2.29, 8.3.0 - 8.3.25, 8.4.1 - 8.4.12
- Array ( [0] => The [1] => nation's [2] => economy [3] => 'is really' [4] => poor [5] => but [6] => "might be getting" [7] => better )
<?php
preg_match_all(
'/(?<![\w\'"])(?:[\'"][^\'"]+[\'"]|[\w\']+)(?![\w\'"])/',
"The nation's economy 'is really' poor, but \"might be getting\" better.",
$matches
);
print_r($matches[0]);