<?xml version="1.0" encoding="windows-1252"?>
<node id="1003910" title="Re: Regular Expressions" created="2012-11-14 20:25:55" updated="2012-11-14 20:25:55">
<type id="11">
note</type>
<author id="622051">
toolic</author>
<data>
<field name="doctext">
I don't think you nedd a nasty regex:

&lt;c&gt;
use warnings;
use strict;
use Scalar::Util qw(looks_like_number);

while (&lt;DATA&gt;) {
    chomp;
    my $temp = $_;
    my $unit = lc chop $temp;
    if (looks_like_number($temp)) {
        print "temp = $temp : unit = $unit\n";
    }
}

__DATA__
55F
77c
foo
+0.4F
&lt;/c&gt;

&lt;p&gt;

&lt;ul&gt;
&lt;li&gt;[doc://Scalar::Util]
&lt;li&gt;[doc://lc]
&lt;li&gt;[doc://chop]
&lt;/ul&gt;
</field>
<field name="root_node">
1003909</field>
<field name="parent_node">
1003909</field>
</data>
</node>
