<?xml version="1.0" encoding="windows-1252"?>
<node id="682585" title="Re: First word" created="2008-04-24 04:56:42" updated="2008-04-24 00:56:42">
<type id="11">
note</type>
<author id="341073">
haoess</author>
<data>
<field name="doctext">
&lt;c&gt;
$ perl -wle 'print shift =~ /^(\w+)\b/' "That's my sentence."
That
&lt;/c&gt;

&lt;p&gt;As you can see, &lt;c&gt;\w&lt;/c&gt; matches a word character, and &lt;c&gt;\b&lt;/c&gt; marks the end of the first word (since we're matching the beginning aka &lt;c&gt;^&lt;/c&gt; of the string).&lt;/p&gt;

&lt;p&gt;More information at [doc://perlre].&lt;/p&gt;

&lt;p&gt;-- Frank&lt;/p&gt;</field>
<field name="root_node">
682581</field>
<field name="parent_node">
682581</field>
</data>
</node>
