Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

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

by japhy (Canon)
on Oct 20, 2000 at 18:15 UTC ( #37668=categorized answer: print w/replies, xml ) Need Help??

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

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

Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (3)
As of 2017-11-19 01:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:













    Results (278 votes). Check out past polls.

    Notices?