Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Programming/Scripts

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 9th July 2008, 23: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
 

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 11:28.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.