This newbie needs help with a regex.  Here's what the data from a text 
file looks like. There's no delimiter and the fields aren't evenly spaced 
apart. 

apples          San Antonio      Fruit
oranges Sacramento             Fruit
pineapples     Honolulu         Fruit
lemons    Corona del Rey       Fruit 

Basically, I want to put the city names into an array.  The first field, 
the fruit name, is always one word with no spaces.

So, I would guess that the regex needs to grab everything after the first 
word and before the beginning of Fruit.  Then strip out all the spaces. 

Or grab the beginning of the second word until the beginning of Fruit. 
Then strip out the spaces after the city name. 

Anyone know how to do that ?

I did recently buy the Mastering Regular Expressions, 2nd Edition book. 
I've only read a little, but I've found the book to be very readable.  If 
I only had the time to really spend with it !  So much to learn, so little 
time.

Thanks in advance for any help.

Reply via email to