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

How to calculate SNR of signals in MATLAB? -

c# - Attempting to upload to FTP: System.Net.WebException: System error -

ios - UISlider customization: how to properly add shadow to custom knob image -