To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.off-topic.geekOpen lugnet.off-topic.geek in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Off-Topic / Geek / 150
149  |  151
Subject: 
Re: regular expressions for DAT file subpart lines
Newsgroups: 
lugnet.off-topic.geek
Date: 
Wed, 23 Jun 1999 13:49:22 GMT
Viewed: 
179 times
  
On Tue, 22 Jun 1999 22:58:55 GMT, Sproaticus <jsproat@geocities.com> wrote:

Whoops!  I need to account for floating point values within the matrix.

You sure do.  Can your code handle the following:

1 4E0 0 0 0 1E0 0 0 0 1E0 0 0 0 1E0 3001.dat

Steve


m/
^
\s*1                               # indicates a subpart
\s+([0-9]+)                        # color
(?:\s+[+-]?[0-9]+(?:\.[0-9]+)?){3} # coordinates
(?:\s+[+-]?[0-9]+(?:\.[0-9]+)?){9} # 3 x 3 transform matrix
\s+(\S+)                           # part name
\s*$
/x

Cheers,
- jsproat
--
Jeremy H. Sproat <jsproat@geocities.com>
http://www.geocities.com/SiliconValley/Horizon/5249/
Darth Maul Lives



Message has 1 Reply:
  Re: regular expressions for DAT file subpart lines
 
(...) Arg. Is this allowed? I guess it should be; the original parser was implemented using Pascal... Yes, ugly getting it is, hmmm? :-, if( $linein =~ m/ ^ \s*1 # indicates a subpart \s+([0-9]+) # color (?:\s+[+-]?[0-9]+(?:...-9+])?){3} # (...) (25 years ago, 23-Jun-99, to lugnet.off-topic.geek)

Message is in Reply To:
  Re: regular expressions for DAT file subpart lines
 
(...) Whoops! I need to account for floating point values within the matrix. m/ ^ \s*1 # indicates a subpart \s+([0-9]+) # color (?:\s+[+-]?[0-9]+(?:...-9]+)?){3} # coordinates (?:\s+[+-]?[0-9]+(?:...-9]+)?){9} # 3 x 3 transform matrix \s+(\S+) # (...) (25 years ago, 22-Jun-99, to lugnet.off-topic.geek)

9 Messages in This Thread:

Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact

This Message and its Replies on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR