I'm trying to write a regex with which I can split a string into tokens. This used to work:
$rawtokens = split("[^-_A-Za-z0-9]+", $string);
But now split() has been deprecated (and using preg_split is recommended), this doesn't work:
$rawtokens = preg_split("[^-_A-Za-z0-9]+", $string);
The error I get is that +\ is an unknown modifier. What's has changed with the migration from split to preg_split?