Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Answer: How do I split on ',' followed by a capital letter?

( #37668=categorized answer: print w/ replies, xml ) Need Help??

Q&A > strings > How do I split on ',' followed by a capital letter? contributed by japhy

You're on the right track. Use a positive look-ahead in your regex:
@fields = split /, (?=[A-Z])/, $string;

Comment on Answer: How do I split on ',' followed by a capital letter?
Download Code
Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (4)
As of 2014-09-02 00:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite cookbook is:










    Results (18 votes), past polls