tlsuess
10th July 2008, 00:22
Hey all,
I am not a pro at REGEX but I'm trying to find a way to do a preg_split command and have it split a string by commas (,) but not while it's within single-quotes (').
So it would match this:
1
2
4
'test,like,this,see'
5
6
'resume,coding'
7
from this:
1,2,4,'test,like,this,see',5,6,'resume,coding',7
Does anyone know of a REGEX pattern I can use or something I can throw into a preg_match call?
Thanks,
Todd
I am not a pro at REGEX but I'm trying to find a way to do a preg_split command and have it split a string by commas (,) but not while it's within single-quotes (').
So it would match this:
1
2
4
'test,like,this,see'
5
6
'resume,coding'
7
from this:
1,2,4,'test,like,this,see',5,6,'resume,coding',7
Does anyone know of a REGEX pattern I can use or something I can throw into a preg_match call?
Thanks,
Todd