Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^2: Splitting on non-initial uppercase without split

by tphyahoo (Vicar)
on Jan 26, 2005 at 12:03 UTC ( [id://425179]=note: print w/replies, xml ) Need Help??


in reply to Re: Splitting on non-initial uppercase without split
in thread Splitting on non-initial uppercase without split

How about:
$s =~ s/([a-z])([A-Z])/$1 $2/ig;
(untested)

Replies are listed 'Best First'.
Re^3: Splitting on non-initial uppercase without split
by si_lence (Deacon) on Jan 26, 2005 at 12:38 UTC
    I guess you would want to make your regex case sensitive:
    $s =~ s/([a-z])([A-Z])/$1 $2/g;

    But then I think it still would not fit the description as it
    woud not split something like "Test1Test2" into "Test1 Test2"
    So following your line of thought it should be something like
    $s =~ s/([^A-Z])([A-Z])/$1 $2/g;

    si_lence

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://425179]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (2)
As of 2024-04-25 20:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found