POV-Ray : Newsgroups : povray.off-topic : Really strange design choices : Re: Trixy Server Time
6 Sep 2024 19:20:17 EDT (-0400)
  Re: Trixy  
From: scott
Date: 18 Dec 2008 09:52:48
Message: <494a63c0@news.povray.org>
>> I meant using regular expressions to help in your parser to decipher 
>> numbers.
>
> I fail to see how a pattern matching language is of help here...

Well it seemed from your example, a "number" is quite easily distinguished 
from a non-number.

A number takes one of the four forms (where n is 1 or more digits):

n.n
n.
.n
n

And is optionally prefixed by a minus sign, and optionally suffixed by an 
exponential term, which takes the form E or e followed by an optional minus 
sign followed by one or more digits.

I would use regular expressions to decide if my string matched this form or 
not, but maybe your language/library already has similar functions to do 
that?


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.