[EMAIL PROTECTED] escribió:
> On Thu, 2008-03-13 at 15:48 +0000, Dave Howorth wrote:
>   
>> Martin (OpenGeoMap) wrote:
>>     
>>> I am building an intermediate  unit system for engineeres in Gobject and 
>>> i hope publish this library soon.
>>> With this system you always work in lineal measures in meters (double), 
>>> and you can input others (inches, centimeters)
>>>
>>> input system - intermediate system -out system
>>>
>>> you can input in a entry for example (22m, 22 m, 220cm,...) and 
>>> internally you have a double always in meters.
>>>       
>> How do you deal with precision? 22 m is not the same as 22.000 m
>>     
>
>   
Yes 22 m is the same as 22.000 m, but the user can be enter both and 
PCRE must understand this.
/(\d+\.?\*)(\s*m)/
If you have "22.000 m"
in PERL you have $1="22.000" and $2="m"

PERL Regular expresions are great in C also, but better in perl and 
Ruby  8-)
To learn a little about regular expresion you need a PERL book:
http://www.oreilly.com/catalog/regex/

> Bad example.  22 can be expressed exactly in 2s complement.  3 cannot.
>
>   
:-\
>> Cheers, Dave
>> _______________________________________________
>> gtk-app-devel-list mailing list
>> gtk-app-devel-list@gnome.org
>> http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
>>     
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Reply via email to