sukhchander wrote:
> Hi Simon,
> 
> That's pretty cool.
> I was looking for a utility similar to Java's StringTokenizer. You just
> pointed it out.
> Ruby has so many things built in. It's very comprehensive.
> 
> For larger regexp I assume you prefer the split/tokenize method?
> 
> I went with the Regexp approach because it occurred to me first.

Personally I'd stick with the regexp approach as it has these advantages:

  - probably faster because you don't have to split and then combine again

  - more precise with regard to matching, i.e. you can better define 
where to match plus you get the info whether the input string is 
properly formatted

Btw, if you want to dive into regexp I can recommend "Mastering Regular 
Expressions".  It's probably best to first get some basic knowledge of 
RX but if you want to know how to build efficient RX etc. then that book 
is definitive a great help.  Ah, I get carried away...

Then there's also tool programs that help in understanding RX visually. 
  RegexBuddy and Regex-Coach.

Kind regards

	robert