Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: ordering array of sentences

by kennethk (Monsignor)
on Nov 13, 2012 at 16:11 UTC ( #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.


Comment on Re: ordering array of sentences
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1003649]
help
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: (11)
As of 2014-09-22 15:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (198 votes), past polls