I dont get it - preg_split patterns?
Posted: Tue Feb 03, 2004 2:35 am
Hi all,
I'm just wonderinf if someone could explain simply how the heck these things work.
I'm just trying to split a string on either a space or a comma, so I look up help on preg_split, but I cant make heads or tails of how the pattern relates to what it is supposed to find.
For example, it says that a pattern of '/[\s,]+/' is going to find 'commas or space characters which include " ".'
Whaaa?!?
Please ... can anyone help me understand this. I've come across it before in a few other functions and I just cant seem to find any info on what it all means.
Thanks
I'm just wonderinf if someone could explain simply how the heck these things work.
I'm just trying to split a string on either a space or a comma, so I look up help on preg_split, but I cant make heads or tails of how the pattern relates to what it is supposed to find.
For example, it says that a pattern of '/[\s,]+/' is going to find 'commas or space characters which include " ".'
Whaaa?!?
Please ... can anyone help me understand this. I've come across it before in a few other functions and I just cant seem to find any info on what it all means.
Thanks