Hey y'all...

The regex below will fail on more esoteric float specifications (exponents,
leading '+' signs, etc).  Here's a complete solution, with tests. It
returns a list of the floats which have been extracted from the given
string, so if you're testing to make sure that there's exactly one float,
you could test the length of the returned list.

The python file attached will do the trick.

Chris

On Thu, Apr 19, 2012 at 10:47 AM, Carlos Trijueque <[email protected]>wrote:

> Nice one.
>
> Thanks.
>
>
> On Thu, Apr 19, 2012 at 5:01 PM, Ron Ganbar <[email protected]> wrote:
>
> > However, I use this: http://pythonregex.com/
> > Which is very helpful.
> _______________________________________________
> Nuke-python mailing list
> [email protected], http://forums.thefoundry.co.uk/
> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
>



-- 
I think this situation absolutely requires that a really futile and stupid
gesture be done on somebody's part. And we're just the guys to do it.

Attachment: FloatRegex.py
Description: Binary data

_______________________________________________
Nuke-python mailing list
[email protected], http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python

Reply via email to