|Syntactic Confectionery Delight|
How do I split on ',' followed by a capital letter?
Contributed by Mina
on Oct 20, 2000 at 18:07 UTC
Q&A > strings
Description:My record is something like this:
News, Product Information, Shopping information, Reference Materials (i.e. dictionaries), Research Materials (i.e. journals, databases), Educational, Hobby / Special Interest (i.e. genealogy, cooking), Financial Material
I'd like to split it by fields, but the commas in the parentheses are a problem.
My initial thought was to use split /,\ [A-Z]/; but would eat away the first letters of the fields.
Better ideas? (maybe the reg exp needs to be craftier, I don't know my brain has turned into jello).
Please (register and) log in if you wish to add an answer