Beefy Boxes and Bandwidth Generously Provided by pair Networks Joe
Keep It Simple, Stupid
 
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 making s'mores by the fire in the courtyard of the Monastery: (10)
As of 2014-04-18 18:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (471 votes), past polls