php - Make a multiple delimiter REGEX for preg_split -


i need split multiple lines in multiple files different delimiters. think preg_split should job never worked pcre regex stuff. change delimiters consistent adds unnecessary calculations.

q: delimiters consist of (,)(;)(|)(space) , curious how build such regex.

put characters in square brackets []:

$parts = preg_split('/[,;| ]/', $string, null, preg_split_no_empty); 

you can use \s instead of space character, matches kinds of whitspace, such tabs , newlines.


Popular posts from this blog

Php - Delimiter must not be alphanumeric or backslash -

c# - How to change the "Applies To" field under folder auditing options programatically (.NET) -

c++ - Ambiguity when using boost::assign::list_of to construct a std::vector -