View Single Post
  #1  
Old 10th July 2008, 00:22
tlsuess tlsuess is offline
Junior Member
 
Join Date: Jul 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default REGEX expression to ignore commas in quotes

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:
Code:
1
2
4
'test,like,this,see'
5
6
'resume,coding'
7
from this:
Code:
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
Reply With Quote
Sponsored Links