Corey Haines wrote:
> but if you can describe why you want to do it, there might be a different way

It is kind of hard to explain but I have a long string that someone 
typed into a form which was then saved into a database.  They used made 
up tags such as "<choose1>, </choose1>, <row>, </row>, <tbl> ..."  I 
have to translate the string into html and add javascript etc. based on 
the different tags they wrote.

I have it working for everything except one task.  In this one task I 
want to pass the words between two tags as a value for the javascript. 
The problem is it is pulling the phrase apart at every space.  I know I 
can add .each(???) and have it pull everything apart at the ??? but it 
would involve a lot of adding ??? to this long string.

What I am trying to do is add a while loop inside the block that will 
look ahead at the next substring to see if it is a "</choose1>".  If it 
is I want it to exit the while loop and go on without throwing away the 
"</choose1>" tag because it is needed next time through the block.

Sorry if that didnt make sense at all.
-- 
Posted via http://www.ruby-forum.com/.