<?xml version="1.0" encoding="windows-1252"?>
<node id="1003649" title="Re: ordering array of sentences" created="2012-11-13 11:11:38" updated="2012-11-13 11:11:38">
<type id="11">
note</type>
<author id="712372">
kennethk</author>
<data>
<field name="doctext">
This definitely sounds like a job for [doc://perlretut|regular expressions].  You should be able to grab the word to the left of &lt;c&gt;searching&lt;/c&gt; [doc://perlretut#Using-character-classes], specifically &lt;c&gt;\S&lt;/c&gt;, which "represents any non-whitespace character".  You can then use that to write your own sorting routine, as described in [doc://sort].  Don't forget that [doc://perlop#Equality-Operators|cmp] is case sensitive, so you may want to use [doc://lc] in your comparison.

&lt;!-- Node text goes above. Div tags should contain sig only --&gt;
&lt;div class="pmsig"&gt;&lt;div class="pmsig-712372"&gt;
&lt;hr /&gt;
&lt;p&gt;#11929 First ask yourself `How would I do this without a computer?'  Then have the computer do it the same way.&lt;/p&gt;
&lt;/div&gt;&lt;/div&gt;</field>
<field name="root_node">
1003644</field>
<field name="parent_node">
1003644</field>
</data>
</node>
