Frederick Cheung wrote:
> Pretend you're split. You see the comma after doe so you split. Then
> you see the other part of your regex and so you split again, resulting
> in the empty array
> 
> Fred

Ok, but the pipe character stands for alternation much like an OR so 
once it sees doe and splits, the next part of the csv input it evaluates 
should match to the monetary portion of the regex so it splits around 
it.  Maybe I'm just not getting somethings because I want it to split my 
(comma delimited) input line based on comma or when a value is wrapped 
with double quotes.

I can always handle the extra empty array positions by simple performing 
a array.delete_if with a block that looks for empty strings but that 
seems like overkill if I could handle it with the regex instead.

Sorry if I'm still not getting the point.

-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to