Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: ordering array of sentences

by kennethk (Abbot)
on Nov 13, 2012 at 16:11 UTC ( [id://1003649]=note: print w/replies, xml ) Need Help??


in reply to ordering array of sentences

This definitely sounds like a job for regular expressions. You should be able to grab the word to the left of searching Using character classes, specifically \S, which "represents any non-whitespace character". You can then use that to write your own sorting routine, as described in sort. Don't forget that cmp is case sensitive, so you may want to use lc in your comparison.

#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (2)
As of 2024-03-19 04:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found