From: John Gesimondo Date: 2010-02-12T03:12:03+09:00 Subject: n00b: text processing from magnetic stip input Hello everyone! I'm trying to make a program and I'm really bad at text processing. The input is a magnetic stripe of a card (coming straight off a card reader). I'm trying to split the output so that each part can get stored in a variable. Here's what comes off the card: %B6007503004905860^GEVIMSEDO/JRPN P^894212333300?;604750230190488515=993612044400050600?+E? And here's what I want (with relevant details): iso = 6007503004905860 [always the same length] last_name = Gevimsedo [variable length, always following carrot symbol] first_name = Jrpn [variable length, always after slash] middle_name = P [ either one letter, or non-existent after frist name separated by a space] If anyone could make that happen, you'd make my day/week/etc. I've been trying for a while, but I'm clearly too much of a n00b. :) -- Posted via http://www.ruby-forum.com/.