What I would suggest is breaking your logic (and code) up into chunks:
- First split the record, more or less as you're doing (I'd split on /\s*,\s*/), but that's a minor quibble).
- Second, process any extraneous text ("Simple Dealin"), trailing whitespace, newlines, etc.
- Make sure that the input values (why do all the entries in the first column look like π/2?) are in the expected range and form. (it looks like the value of the input must be greater than or equal to zero and less than ten)
- Validate the time in whatever way you require
I'm sure there's a regex that would do everything in one swell foop, but my regex mojo hasn't fully wakened yet.
Information about American English usage here and here. Floating point issues? Please read this before posting. — emc