I am writing a regular expression for preg_split () so that the line is broken down by spaces + with all possible punctuation marks. While it looks like this:
$pattern = "/[\s,;.\!\-\?\:\(\)]+/"; How to add a long dash to the expression, all possible quotes, etc. (maybe I forgot some other punctuation marks)?
preg_split()with such an expression adds an empty element to the end of the array. It is clear that it can be cut later, but I do not like this decision. How to correct expression so that there is no empty element?
Thank!
trim+/\W+/uto help you. - Dmitriy Simushev