|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
php regex question
I need some help with regular expressions.
I have a string that looks like this (exactly) (index1 => "hi, my name is brian",index2 => 12) I want to perform a split on this string using ONLY commas outside of quotes as my delimiter. Any ideas? |
|
#2
|
|||
|
|||
|
Try this;
PHP Code:
|
|
#3
|
|||
|
|||
|
Harry,
Wouldn't that be a problem though? Look at the first record: "Hi, my name is brian" Would there not be a problem with the comma after "hi"?
__________________
____________________________________________ Developer Shed Weekly Writer | DevArticles Forum Moderator Build Your Own KlipFolio Klip With PHP FrankManno.com - Under Construction Design Interactive Group - Under Construction |
|
#4
|
|||
|
|||
|
No - it should work because the "search string" I'm using is - ", -
In general it's dodgy having to parse strings like that (better to have the string in XML form if possible) but this works for this specific case - give it a try. |
|
#5
|
|||
|
|||
|
My mistake, I didn't see the first single-quote...
I see what you mean though. |
![]() |
| Viewing: Dev Articles Community Forums > Programming > PHP Development > php regex question |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|